Skip to content

Commit 793adeb

Browse files
lib Types and Documentations Fix
1 parent 8d7ad8c commit 793adeb

30 files changed

+207
-246
lines changed

src/lib/es5.d.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,14 @@ interface CallableFunction extends Function {
311311
/**
312312
* Calls the function with the specified object as the this value and the elements of specified array as the arguments.
313313
* @param thisArg The object to be used as the this object.
314-
* @param args An array of argument values to be passed to the function.
315314
*/
316315
apply<T, R>(this: (this: T) => R, thisArg: T): R;
316+
317+
/**
318+
* Calls the function with the specified object as the this value and the elements of specified array as the arguments.
319+
* @param thisArg The object to be used as the this object.
320+
* @param args An array of argument values to be passed to the function.
321+
*/
317322
apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;
318323

319324
/**
@@ -327,23 +332,29 @@ interface CallableFunction extends Function {
327332
* For a given function, creates a bound function that has the same body as the original function.
328333
* The this object of the bound function is associated with the specified object, and has the specified initial parameters.
329334
* @param thisArg The object to be used as the this object.
330-
* @param args Arguments to bind to the parameters of the function.
331335
*/
332336
bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
333-
bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;
334-
bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;
335-
bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;
336-
bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;
337-
bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;
337+
338+
/**
339+
* For a given function, creates a bound function that has the same body as the original function.
340+
* The this object of the bound function is associated with the specified object, and has the specified initial parameters.
341+
* @param thisArg The object to be used as the this object.
342+
* @param args Arguments to bind to the parameters of the function.
343+
*/
344+
bind<T, A extends any[], B extends any[], R>(this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R;
338345
}
339346

340347
interface NewableFunction extends Function {
341348
/**
342349
* Calls the function with the specified object as the this value and the elements of specified array as the arguments.
343350
* @param thisArg The object to be used as the this object.
344-
* @param args An array of argument values to be passed to the function.
345351
*/
346352
apply<T>(this: new () => T, thisArg: T): void;
353+
/**
354+
* Calls the function with the specified object as the this value and the elements of specified array as the arguments.
355+
* @param thisArg The object to be used as the this object.
356+
* @param args An array of argument values to be passed to the function.
357+
*/
347358
apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;
348359

349360
/**
@@ -357,14 +368,16 @@ interface NewableFunction extends Function {
357368
* For a given function, creates a bound function that has the same body as the original function.
358369
* The this object of the bound function is associated with the specified object, and has the specified initial parameters.
359370
* @param thisArg The object to be used as the this object.
360-
* @param args Arguments to bind to the parameters of the function.
361371
*/
362372
bind<T>(this: T, thisArg: any): T;
363-
bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;
364-
bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;
365-
bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;
366-
bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;
367-
bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;
373+
374+
/**
375+
* For a given function, creates a bound function that has the same body as the original function.
376+
* The this object of the bound function is associated with the specified object, and has the specified initial parameters.
377+
* @param thisArg The object to be used as the this object.
378+
* @param args Arguments to bind to the parameters of the function.
379+
*/
380+
bind<A extends any[], B extends any[], R>(this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R;
368381
}
369382

370383
interface IArguments {

tests/baselines/reference/destructuringParameterDeclaration4.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(
4141
a1(...array2); // Error parameter type is (number|string)[]
4242
~~~~~~
4343
!!! error TS2552: Cannot find name 'array2'. Did you mean 'Array'?
44-
!!! related TS2728 /.ts/lib.es5.d.ts:1490:13: 'Array' is declared here.
44+
!!! related TS2728 /.ts/lib.es5.d.ts:1503:13: 'Array' is declared here.
4545
a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]]
4646
~~~~~~~~
4747
!!! error TS2322: Type 'string' is not assignable to type '[[any]]'.

tests/baselines/reference/destructuringTuple.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload mat
3333
!!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error.
3434
!!! error TS2769: Type 'never[]' is not assignable to type '[]'.
3535
!!! error TS2769: Target allows only 0 element(s) but source may have more.
36-
!!! related TS6502 /.ts/lib.es5.d.ts:1455:24: The expected type comes from the return type of this signature.
37-
!!! related TS6502 /.ts/lib.es5.d.ts:1461:27: The expected type comes from the return type of this signature.
36+
!!! related TS6502 /.ts/lib.es5.d.ts:1468:24: The expected type comes from the return type of this signature.
37+
!!! related TS6502 /.ts/lib.es5.d.ts:1474:27: The expected type comes from the return type of this signature.
3838
~~
3939
!!! error TS2769: No overload matches this call.
4040
!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.

tests/baselines/reference/duplicateNumericIndexers.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ tests/cases/conformance/types/members/duplicateNumericIndexers.ts(24,5): error T
1010
tests/cases/conformance/types/members/duplicateNumericIndexers.ts(25,5): error TS2374: Duplicate index signature for type 'number'.
1111
tests/cases/conformance/types/members/duplicateNumericIndexers.ts(29,5): error TS2374: Duplicate index signature for type 'number'.
1212
tests/cases/conformance/types/members/duplicateNumericIndexers.ts(30,5): error TS2374: Duplicate index signature for type 'number'.
13-
lib.es5.d.ts(517,5): error TS2374: Duplicate index signature for type 'number'.
14-
lib.es5.d.ts(1476,5): error TS2374: Duplicate index signature for type 'number'.
13+
lib.es5.d.ts(530,5): error TS2374: Duplicate index signature for type 'number'.
14+
lib.es5.d.ts(1489,5): error TS2374: Duplicate index signature for type 'number'.
1515

1616

1717
==== tests/cases/conformance/types/members/duplicateNumericIndexers.ts (12 errors) ====

tests/baselines/reference/externModule.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ tests/cases/compiler/externModule.ts(37,3): error TS2552: Cannot find name 'XDat
6666
var d=new XDate();
6767
~~~~~
6868
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
69-
!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here.
69+
!!! related TS2728 /.ts/lib.es5.d.ts:950:13: 'Date' is declared here.
7070
d.getDay();
7171
d=new XDate(1978,2);
7272
~~~~~
7373
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
74-
!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here.
74+
!!! related TS2728 /.ts/lib.es5.d.ts:950:13: 'Date' is declared here.
7575
d.getXDate();
7676
var n=XDate.parse("3/2/2004");
7777
~~~~~
7878
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
79-
!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here.
79+
!!! related TS2728 /.ts/lib.es5.d.ts:950:13: 'Date' is declared here.
8080
n=XDate.UTC(1964,2,1);
8181
~~~~~
8282
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
83-
!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here.
83+
!!! related TS2728 /.ts/lib.es5.d.ts:950:13: 'Date' is declared here.
8484

8585

tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts(3,1): error T
77
tgt2 = src2; // Should error
88
~~~~
99
!!! error TS2741: Property 'length' is missing in type '{ [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray<number>[]): number[]; (...items: (number | ConcatArray<number>)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { <S extends number>(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { <S extends number>(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; <U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; <U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { <S extends number>(predicate: (this: void, value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator<number>; values: () => IterableIterator<number>; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: <A, D extends number = 1>(this: A, depth?: D) => FlatArray<A, D>[]; [iterator]: () => IterableIterator<number>; [unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; }' but required in type 'number[]'.
10-
!!! related TS2728 /.ts/lib.es5.d.ts:1299:5: 'length' is declared here.
10+
!!! related TS2728 /.ts/lib.es5.d.ts:1312:5: 'length' is declared here.
1111

tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts(16,17)
2424
err.massage; // ERROR: Property 'massage' does not exist on type 'Error'
2525
~~~~~~~
2626
!!! error TS2551: Property 'massage' does not exist on type 'Error'. Did you mean 'message'?
27-
!!! related TS2728 /.ts/lib.es5.d.ts:1049:5: 'message' is declared here.
27+
!!! related TS2728 /.ts/lib.es5.d.ts:1062:5: 'message' is declared here.
2828
}
2929

3030
else {

tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS
2222
x.mesage;
2323
~~~~~~
2424
!!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'?
25-
!!! related TS2728 /.ts/lib.es5.d.ts:1049:5: 'message' is declared here.
25+
!!! related TS2728 /.ts/lib.es5.d.ts:1062:5: 'message' is declared here.
2626
}
2727

2828
if (x instanceof Date) {
2929
x.getDate();
3030
x.getHuors();
3131
~~~~~~~~
3232
!!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'?
33-
!!! related TS2728 /.ts/lib.es5.d.ts:783:5: 'getHours' is declared here.
33+
!!! related TS2728 /.ts/lib.es5.d.ts:796:5: 'getHours' is declared here.
3434
}
3535

tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error
4141
x.mesage;
4242
~~~~~~
4343
!!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'?
44-
!!! related TS2728 /.ts/lib.es5.d.ts:1049:5: 'message' is declared here.
44+
!!! related TS2728 /.ts/lib.es5.d.ts:1062:5: 'message' is declared here.
4545
}
4646

4747
if (isDate(x)) {
4848
x.getDate();
4949
x.getHuors();
5050
~~~~~~~~
5151
!!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'?
52-
!!! related TS2728 /.ts/lib.es5.d.ts:783:5: 'getHours' is declared here.
52+
!!! related TS2728 /.ts/lib.es5.d.ts:796:5: 'getHours' is declared here.
5353
}
5454

tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPo
1111
!!! error TS1005: ';' expected.
1212
~~~~~~~~
1313
!!! error TS2552: Cannot find name 'toString'. Did you mean 'String'?
14-
!!! related TS2728 /.ts/lib.es5.d.ts:530:13: 'String' is declared here.
14+
!!! related TS2728 /.ts/lib.es5.d.ts:543:13: 'String' is declared here.

tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre
77
/notregexp/a.foo();
88
~~~~~~~~~
99
!!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'?
10-
!!! related TS2728 /.ts/lib.es5.d.ts:1045:13: 'RegExp' is declared here.
10+
!!! related TS2728 /.ts/lib.es5.d.ts:1058:13: 'RegExp' is declared here.
1111
~
1212
!!! error TS2304: Cannot find name 'a'.

tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre
66
(1) /notregexp/a.foo();
77
~~~~~~~~~
88
!!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'?
9-
!!! related TS2728 /.ts/lib.es5.d.ts:1045:13: 'RegExp' is declared here.
9+
!!! related TS2728 /.ts/lib.es5.d.ts:1058:13: 'RegExp' is declared here.
1010
~
1111
!!! error TS2304: Cannot find name 'a'.

tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS
1919
$ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x));
2020
~~~~~~
2121
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
22-
!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here.
22+
!!! related TS2728 /.ts/lib.es5.d.ts:1072:13: 'Error' is declared here.
2323
}
2424

2525
//CHECK#2
@@ -28,7 +28,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS
2828
$ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x));
2929
~~~~~~
3030
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
31-
!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here.
31+
!!! related TS2728 /.ts/lib.es5.d.ts:1072:13: 'Error' is declared here.
3232
}
3333

3434

tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.3_A1.1_T2.ts(17,3): error TS
2121
$ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x));
2222
~~~~~~
2323
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
24-
!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here.
24+
!!! related TS2728 /.ts/lib.es5.d.ts:1072:13: 'Error' is declared here.
2525
}
2626

2727

0 commit comments

Comments
 (0)