Merge branch 'master' of https://github.com/Microsoft/TypeScript into remove_resolveLocation

This commit is contained in:
Jason Freeman
2015-07-20 13:40:17 -07:00
6 changed files with 58 additions and 4 deletions
+3 -3
View File
@@ -971,14 +971,14 @@ interface JSON {
* @param replacer A function that transforms the results.
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
*/
stringify(value: any, replacer: (key: string, value: any) => any, space: any): string;
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
/**
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
* @param value A JavaScript value, usually an object or array, to be converted.
* @param replacer Array that transforms the results.
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
*/
stringify(value: any, replacer: any[], space: any): string;
stringify(value: any, replacer: any[], space: string | number): string;
}
/**
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
@@ -1181,4 +1181,4 @@ interface PromiseLike<T> {
*/
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
}
}
+1 -1
View File
@@ -377,7 +377,7 @@ interface String {
* @param searchString search string
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
*/
contains(searchString: string, position?: number): boolean;
includes(searchString: string, position?: number): boolean;
/**
* Returns true if the sequence of elements of searchString converted to a String is the
@@ -0,0 +1,10 @@
//// [stringIncludes.ts]
var includes: boolean;
includes = "abcde".includes("cd");
includes = "abcde".includes("cd", 2);
//// [stringIncludes.js]
var includes;
includes = "abcde".includes("cd");
includes = "abcde".includes("cd", 2);
@@ -0,0 +1,15 @@
=== tests/cases/compiler/stringIncludes.ts ===
var includes: boolean;
>includes : Symbol(includes, Decl(stringIncludes.ts, 1, 3))
includes = "abcde".includes("cd");
>includes : Symbol(includes, Decl(stringIncludes.ts, 1, 3))
>"abcde".includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
>includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
includes = "abcde".includes("cd", 2);
>includes : Symbol(includes, Decl(stringIncludes.ts, 1, 3))
>"abcde".includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
>includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
@@ -0,0 +1,24 @@
=== tests/cases/compiler/stringIncludes.ts ===
var includes: boolean;
>includes : boolean
includes = "abcde".includes("cd");
>includes = "abcde".includes("cd") : boolean
>includes : boolean
>"abcde".includes("cd") : boolean
>"abcde".includes : (searchString: string, position?: number) => boolean
>"abcde" : string
>includes : (searchString: string, position?: number) => boolean
>"cd" : string
includes = "abcde".includes("cd", 2);
>includes = "abcde".includes("cd", 2) : boolean
>includes : boolean
>"abcde".includes("cd", 2) : boolean
>"abcde".includes : (searchString: string, position?: number) => boolean
>"abcde" : string
>includes : (searchString: string, position?: number) => boolean
>"cd" : string
>2 : number
+5
View File
@@ -0,0 +1,5 @@
//@target: ES6
var includes: boolean;
includes = "abcde".includes("cd");
includes = "abcde".includes("cd", 2);