mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' of https://github.com/Microsoft/TypeScript into remove_resolveLocation
This commit is contained in:
Vendored
+3
-3
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
//@target: ES6
|
||||
|
||||
var includes: boolean;
|
||||
includes = "abcde".includes("cd");
|
||||
includes = "abcde".includes("cd", 2);
|
||||
Reference in New Issue
Block a user