Skip to content

Commit fffe6c5

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript into remove_resolveLocation
2 parents 05bc4fe + 96b02a8 commit fffe6c5

File tree

6 files changed

+58
-4
lines changed

6 files changed

+58
-4
lines changed

src/lib/core.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,14 +971,14 @@ interface JSON {
971971
* @param replacer A function that transforms the results.
972972
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
973973
*/
974-
stringify(value: any, replacer: (key: string, value: any) => any, space: any): string;
974+
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
975975
/**
976976
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
977977
* @param value A JavaScript value, usually an object or array, to be converted.
978978
* @param replacer Array that transforms the results.
979979
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
980980
*/
981-
stringify(value: any, replacer: any[], space: any): string;
981+
stringify(value: any, replacer: any[], space: string | number): string;
982982
}
983983
/**
984984
* 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> {
11811181
*/
11821182
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
11831183
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
1184-
}
1184+
}

src/lib/es6.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ interface String {
377377
* @param searchString search string
378378
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
379379
*/
380-
contains(searchString: string, position?: number): boolean;
380+
includes(searchString: string, position?: number): boolean;
381381

382382
/**
383383
* Returns true if the sequence of elements of searchString converted to a String is the
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//// [stringIncludes.ts]
2+
3+
var includes: boolean;
4+
includes = "abcde".includes("cd");
5+
includes = "abcde".includes("cd", 2);
6+
7+
//// [stringIncludes.js]
8+
var includes;
9+
includes = "abcde".includes("cd");
10+
includes = "abcde".includes("cd", 2);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
=== tests/cases/compiler/stringIncludes.ts ===
2+
3+
var includes: boolean;
4+
>includes : Symbol(includes, Decl(stringIncludes.ts, 1, 3))
5+
6+
includes = "abcde".includes("cd");
7+
>includes : Symbol(includes, Decl(stringIncludes.ts, 1, 3))
8+
>"abcde".includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
9+
>includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
10+
11+
includes = "abcde".includes("cd", 2);
12+
>includes : Symbol(includes, Decl(stringIncludes.ts, 1, 3))
13+
>"abcde".includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
14+
>includes : Symbol(String.includes, Decl(lib.d.ts, 1569, 37))
15+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
=== tests/cases/compiler/stringIncludes.ts ===
2+
3+
var includes: boolean;
4+
>includes : boolean
5+
6+
includes = "abcde".includes("cd");
7+
>includes = "abcde".includes("cd") : boolean
8+
>includes : boolean
9+
>"abcde".includes("cd") : boolean
10+
>"abcde".includes : (searchString: string, position?: number) => boolean
11+
>"abcde" : string
12+
>includes : (searchString: string, position?: number) => boolean
13+
>"cd" : string
14+
15+
includes = "abcde".includes("cd", 2);
16+
>includes = "abcde".includes("cd", 2) : boolean
17+
>includes : boolean
18+
>"abcde".includes("cd", 2) : boolean
19+
>"abcde".includes : (searchString: string, position?: number) => boolean
20+
>"abcde" : string
21+
>includes : (searchString: string, position?: number) => boolean
22+
>"cd" : string
23+
>2 : number
24+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@target: ES6
2+
3+
var includes: boolean;
4+
includes = "abcde".includes("cd");
5+
includes = "abcde".includes("cd", 2);

0 commit comments

Comments
 (0)