You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/es5.d.ts
+60-19Lines changed: 60 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1235,7 +1235,12 @@ interface Array<T> {
1235
1235
slice(start?: number,end?: number): T[];
1236
1236
/**
1237
1237
* Sorts an array.
1238
-
* @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
1238
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
1239
+
* a negative value if first argument is less than second argument, zero if they're equal and a positive
1240
+
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
1241
+
* ```ts
1242
+
* [11,2,22,1].sort((a, b) => a - b)
1243
+
* ```
1239
1244
*/
1240
1245
sort(compareFn?: (a: T,b: T)=>number): this;
1241
1246
/**
@@ -1876,8 +1881,12 @@ interface Int8Array {
1876
1881
1877
1882
/**
1878
1883
* Sorts an array.
1879
-
* @param compareFn The name of the function used to determine the order of the elements. If
1880
-
* omitted, the elements are sorted in ascending, ASCII character order.
1884
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
1885
+
* a negative value if first argument is less than second argument, zero if they're equal and a positive
1886
+
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
Copy file name to clipboardExpand all lines: tests/baselines/reference/promisePermutations3.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -398,7 +398,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
398
398
!!! error TS2769: The last overload gave the following error.
399
399
!!! error TS2769: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
400
400
!!! error TS2769: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
401
-
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
401
+
!!! related TS2728 /.ts/lib.es5.d.ts:1418:5: 'catch' is declared here.
402
402
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
403
403
var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok
404
404
@@ -445,5 +445,5 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
445
445
~~~~~~~~~~~~~~~
446
446
!!! error TS2345: Argument of type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<unknown>'.
447
447
!!! error TS2345: Property 'catch' is missing in type 'IPromise<any>' but required in type 'Promise<unknown>'.
448
-
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
448
+
!!! related TS2728 /.ts/lib.es5.d.ts:1418:5: 'catch' is declared here.
449
449
var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok
0 commit comments