From 8da75d949de9d14dce6bb30e1bc64f3c06d691c0 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 18 Sep 2020 06:20:53 +0000 Subject: [PATCH 1/5] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7df8a93637a2b..676abd3b3020a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -550,9 +550,9 @@ "dev": true }, "@types/node": { - "version": "14.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.3.tgz", - "integrity": "sha512-zdN0hor7TLkjAdKTnYW+Y22oIhUUpil5ZD1V1OFq0CR0CLKw+NdR6dkziTfkWRLo6sKzisayoj/GNpNbe4LY9Q==", + "version": "14.11.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.1.tgz", + "integrity": "sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==", "dev": true }, "@types/node-fetch": { From b98d998016df5d2027497bf9ae2677d9b23ef6e4 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 22 Sep 2020 06:21:36 +0000 Subject: [PATCH 2/5] Update package-lock.json --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 676abd3b3020a..8906cb88f5d86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -550,9 +550,9 @@ "dev": true }, "@types/node": { - "version": "14.11.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.1.tgz", - "integrity": "sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==", + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", "dev": true }, "@types/node-fetch": { @@ -8126,9 +8126,9 @@ "dev": true }, "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", "dev": true, "requires": { "clone": "^2.1.1", From bb21fbef833501e69a5edf1fe5966078cf78cf0a Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sat, 26 Sep 2020 06:27:05 +0000 Subject: [PATCH 3/5] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8906cb88f5d86..94b6118f8e0f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -511,9 +511,9 @@ } }, "@types/microsoft__typescript-etw": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@types/microsoft__typescript-etw/-/microsoft__typescript-etw-0.1.0.tgz", - "integrity": "sha512-ShankhBwAF3LZAkkby3w++HNhwPjWJDv0rSjrHNXO/Nlt/63mSZKNhfu99PNq+Nmyy1xGNknreKacpEuvpeWNA==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@types/microsoft__typescript-etw/-/microsoft__typescript-etw-0.1.1.tgz", + "integrity": "sha512-zdgHyZJEwbFKI6zhOqWPsNMhlrAk6qMrn9VMA6VQtRt/F+jNJKeaHIMysuO9oTLv0fWcli0gwUrMv8MeFyb3Sw==", "dev": true }, "@types/minimatch": { From c1b39c5145293a057c7dd1895cc631306a7d84b6 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 28 Sep 2020 06:22:09 +0000 Subject: [PATCH 4/5] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 94b6118f8e0f1..94c85d1836fbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7875,9 +7875,9 @@ "dev": true }, "uglify-js": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", - "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.0.tgz", + "integrity": "sha512-e1KQFRCpOxnrJsJVqDUCjURq+wXvIn7cK2sRAx9XL3HYLL9aezOP4Pb1+Y3/o693EPk111Yj2Q+IUXxcpHlygQ==", "dev": true, "optional": true }, From d76b6f3f8ebe2d034b16cf572e0e71ca940a8bf4 Mon Sep 17 00:00:00 2001 From: Vincent Boivin Date: Sun, 4 Oct 2020 00:14:40 -0400 Subject: [PATCH 5/5] Fixes #40929 --- src/compiler/utilities.ts | 7 ++++--- ...hangeYourTargetLibraryES2016Plus.errors.txt | 16 ++++++++-------- ...uNeedToChangeYourTargetLibraryES2016Plus.js | 8 ++++---- ...ToChangeYourTargetLibraryES2016Plus.symbols | 4 ++-- ...edToChangeYourTargetLibraryES2016Plus.types | 18 ++++++++---------- ...uNeedToChangeYourTargetLibraryES2016Plus.ts | 4 ++-- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index e56356afbcea1..ec0b768a1ad92 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -556,7 +556,8 @@ namespace ts { Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], Map: ["entries", "keys", "values"], Set: ["entries", "keys", "values"], - Promise: ["all", "race", "reject", "resolve"], + Promise: emptyArray, + PromiseConstructor: ["all", "race", "reject", "resolve"], Symbol: ["for", "keyFor"], WeakMap: ["entries", "keys", "values"], WeakSet: ["entries", "keys", "values"], @@ -596,14 +597,14 @@ namespace ts { BigInt: emptyArray, BigInt64Array: emptyArray, BigUint64Array: emptyArray, - Promise: ["allSettled"], + PromiseConstructor: ["allSettled"], SymbolConstructor: ["matchAll"], String: ["matchAll"], DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] }, esnext: { - Promise: ["any"], + PromiseConstructor: ["any"], String: ["replaceAll"], NumberFormat: ["formatToParts"] } diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt index 24388413b3c74..404b95152c795 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt @@ -24,11 +24,11 @@ tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(30,30): err tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(31,31): error TS2550: Property 'trimLeft' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(32,32): error TS2550: Property 'trimRight' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(33,45): error TS2550: Property 'description' does not exist on type 'symbol'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. -tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(36,53): error TS2550: Property 'allSettled' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(36,39): error TS2550: Property 'allSettled' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(37,31): error TS2550: Property 'matchAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(38,47): error TS2550: Property 'matchAll' does not exist on type 'SymbolConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(39,20): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. -tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(42,46): error TS2550: Property 'any' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(42,32): error TS2550: Property 'any' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(43,33): error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,70): error TS2550: Property 'formatToParts' does not exist on type 'NumberFormat'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. @@ -122,9 +122,9 @@ tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,70): err !!! error TS2550: Property 'description' does not exist on type 'symbol'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. // es2020 - const testPromiseAllSettled = new Promise(() => {}).allSettled(); - ~~~~~~~~~~ -!!! error TS2550: Property 'allSettled' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. + const testPromiseAllSettled = Promise.allSettled([]); + ~~~~~~~~~~ +!!! error TS2550: Property 'allSettled' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. const testStringMatchAll = "".matchAll(); ~~~~~~~~ !!! error TS2550: Property 'matchAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. @@ -136,9 +136,9 @@ tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,70): err !!! error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. // esnext - const testPromiseAny = new Promise(() => {}).any(); - ~~~ -!!! error TS2550: Property 'any' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. + const testPromiseAny = Promise.any([]); + ~~~ +!!! error TS2550: Property 'any' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. const testStringReplaceAll = "".replaceAll(); ~~~~~~~~~~ !!! error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js index 9dd50e73b6a90..3acfb2e08f465 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js @@ -34,13 +34,13 @@ const testStringTrimRight = "".trimRight(); const testSymbolDescription = Symbol("foo").description; // es2020 -const testPromiseAllSettled = new Promise(() => {}).allSettled(); +const testPromiseAllSettled = Promise.allSettled([]); const testStringMatchAll = "".matchAll(); const testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); const testBigInt = BigInt(123); // esnext -const testPromiseAny = new Promise(() => {}).any(); +const testPromiseAny = Promise.any([]); const testStringReplaceAll = "".replaceAll(); const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); @@ -76,11 +76,11 @@ var testStringTrimLeft = "".trimLeft(); var testStringTrimRight = "".trimRight(); var testSymbolDescription = Symbol("foo").description; // es2020 -var testPromiseAllSettled = new Promise(function () { }).allSettled(); +var testPromiseAllSettled = Promise.allSettled([]); var testStringMatchAll = "".matchAll(); var testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); var testBigInt = BigInt(123); // esnext -var testPromiseAny = new Promise(function () { }).any(); +var testPromiseAny = Promise.any([]); var testStringReplaceAll = "".replaceAll(); var testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols index 3ebf4065550cd..228d943e2247b 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols @@ -97,7 +97,7 @@ const testSymbolDescription = Symbol("foo").description; >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) // es2020 -const testPromiseAllSettled = new Promise(() => {}).allSettled(); +const testPromiseAllSettled = Promise.allSettled([]); >testPromiseAllSettled : Symbol(testPromiseAllSettled, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 35, 5)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -112,7 +112,7 @@ const testBigInt = BigInt(123); >testBigInt : Symbol(testBigInt, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 38, 5)) // esnext -const testPromiseAny = new Promise(() => {}).any(); +const testPromiseAny = Promise.any([]); >testPromiseAny : Symbol(testPromiseAny, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 41, 5)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types index 6248a1e6b0912..fb0578caf230e 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types @@ -207,14 +207,13 @@ const testSymbolDescription = Symbol("foo").description; >description : any // es2020 -const testPromiseAllSettled = new Promise(() => {}).allSettled(); +const testPromiseAllSettled = Promise.allSettled([]); >testPromiseAllSettled : any ->new Promise(() => {}).allSettled() : any ->new Promise(() => {}).allSettled : any ->new Promise(() => {}) : Promise +>Promise.allSettled([]) : any +>Promise.allSettled : any >Promise : PromiseConstructor ->() => {} : () => void >allSettled : any +>[] : undefined[] const testStringMatchAll = "".matchAll(); >testStringMatchAll : any @@ -240,14 +239,13 @@ const testBigInt = BigInt(123); >123 : 123 // esnext -const testPromiseAny = new Promise(() => {}).any(); +const testPromiseAny = Promise.any([]); >testPromiseAny : any ->new Promise(() => {}).any() : any ->new Promise(() => {}).any : any ->new Promise(() => {}) : Promise +>Promise.any([]) : any +>Promise.any : any >Promise : PromiseConstructor ->() => {} : () => void >any : any +>[] : undefined[] const testStringReplaceAll = "".replaceAll(); >testStringReplaceAll : any diff --git a/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts index 901d53c021a09..897c4e8e5dcbd 100644 --- a/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts +++ b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts @@ -35,12 +35,12 @@ const testStringTrimRight = "".trimRight(); const testSymbolDescription = Symbol("foo").description; // es2020 -const testPromiseAllSettled = new Promise(() => {}).allSettled(); +const testPromiseAllSettled = Promise.allSettled([]); const testStringMatchAll = "".matchAll(); const testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); const testBigInt = BigInt(123); // esnext -const testPromiseAny = new Promise(() => {}).any(); +const testPromiseAny = Promise.any([]); const testStringReplaceAll = "".replaceAll(); const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); \ No newline at end of file