Skip to content

Commit 7b04d3f

Browse files
committed
Move this Promise.race() overload back to es2015.iterable.d.ts
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
1 parent d3855d6 commit 7b04d3f

10 files changed

+17
-17
lines changed

src/lib/es2015.iterable.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ interface PromiseConstructor {
208208
/**
209209
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
210210
* or rejected.
211-
* @param values An array of Promises.
211+
* @param values An iterable of Promises.
212212
* @returns A new Promise.
213213
*/
214-
race<T>(values: Iterable<T | PromiseLike<T>>): Promise<T>;
214+
race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
215215
}
216216

217217
declare namespace Reflect {

src/lib/es2015.promise.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,6 @@ interface PromiseConstructor {
100100
*/
101101
race<T>(values: readonly T[]): Promise<T extends PromiseLike<infer U> ? U : T>;
102102

103-
/**
104-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
105-
* or rejected.
106-
* @param values An iterable of Promises.
107-
* @returns A new Promise.
108-
*/
109-
race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
110-
111103
/**
112104
* Creates a new rejected promise for the provided reason.
113105
* @param reason The reason the promise was rejected.

tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es20
1616
!!! error TS1005: ',' expected.
1717
~~~~~~~
1818
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
19-
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here.
19+
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:144:13: 'Promise' was also declared here.
2020
~
2121
!!! error TS1005: ',' expected.
2222
~~

tests/baselines/reference/asyncArrowFunction5_es5.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(
1616
!!! error TS1005: ',' expected.
1717
~~~~~~~
1818
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
19-
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here.
19+
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:144:13: 'Promise' was also declared here.
2020
~
2121
!!! error TS1005: ',' expected.
2222
~~

tests/baselines/reference/asyncArrowFunction5_es6.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(
1616
!!! error TS1005: ',' expected.
1717
~~~~~~~
1818
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
19-
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here.
19+
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:144:13: 'Promise' was also declared here.
2020
~
2121
!!! error TS1005: ',' expected.
2222
~~

tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es20
1616
!!! error TS1005: ',' expected.
1717
~~~~~~~
1818
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
19-
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here.
19+
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:144:13: 'Promise' was also declared here.
2020
~
2121
!!! error TS1005: ',' expected.
2222
~~

tests/baselines/reference/asyncArrowFunction9_es5.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(
1616
!!! error TS1005: ',' expected.
1717
~~~~~~~
1818
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
19-
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here.
19+
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:144:13: 'Promise' was also declared here.
2020
~
2121
!!! error TS1005: ',' expected.
2222
~~

tests/baselines/reference/asyncArrowFunction9_es6.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(
1616
!!! error TS1005: ',' expected.
1717
~~~~~~~
1818
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'.
19-
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here.
19+
!!! related TS6203 /.ts/lib.es2015.promise.d.ts:144:13: 'Promise' was also declared here.
2020
~
2121
!!! error TS1005: ',' expected.
2222
~~

tests/baselines/reference/user/create-react-app.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Exit Code: 1
22
Standard output:
3-
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,8): error TS8010: 'types' can only be used in a .ts file.
3+
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,8): error TS8010: Type annotations can only be used in TypeScript files.
44
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,13): error TS1005: ';' expected.
55
test/fixtures/webpack-message-formatting/src/AppBabel.js(6,8): error TS17008: JSX element 'div' has no corresponding closing tag.
66
test/fixtures/webpack-message-formatting/src/AppBabel.js(8,7): error TS17002: Expected corresponding JSX closing tag for 'span'.

tests/baselines/reference/user/npm.log

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,14 @@ node_modules/npm/lib/whoami.js(18,18): error TS2339: Property 'config' does not
925925
node_modules/npm/lib/whoami.js(24,18): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'.
926926
node_modules/npm/lib/whoami.js(30,26): error TS2339: Property 'code' does not exist on type 'Error'.
927927
node_modules/npm/lib/whoami.js(45,12): error TS2339: Property 'code' does not exist on type 'Error'.
928+
node_modules/npm/scripts/index-build.js(20,13): error TS2531: Object is possibly 'null'.
929+
node_modules/npm/scripts/index-build.js(20,22): error TS2531: Object is possibly 'null'.
930+
node_modules/npm/scripts/index-build.js(21,30): error TS2531: Object is possibly 'null'.
931+
node_modules/npm/scripts/index-build.js(22,29): error TS2531: Object is possibly 'null'.
932+
node_modules/npm/scripts/index-build.js(23,15): error TS2531: Object is possibly 'null'.
933+
node_modules/npm/scripts/index-build.js(23,22): error TS2531: Object is possibly 'null'.
934+
node_modules/npm/scripts/index-build.js(24,15): error TS2531: Object is possibly 'null'.
935+
node_modules/npm/scripts/index-build.js(24,22): error TS2531: Object is possibly 'null'.
928936
node_modules/npm/scripts/publish-tag.js(2,36): error TS2732: Cannot find module '../package.json'. Consider using '--resolveJsonModule' to import module with '.json' extension
929937
node_modules/npm/test/broken-under-nyc-and-travis/lifecycle-path.js(7,20): error TS2307: Cannot find module 'tap'.
930938
node_modules/npm/test/broken-under-nyc-and-travis/lifecycle-path.js(18,23): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

0 commit comments

Comments
 (0)