diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index fe0031d1f2afd..b9d39151148a1 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -29,6 +29,7 @@ namespace ts { ["es2019", "lib.es2019.d.ts"], ["es2020", "lib.es2020.d.ts"], ["es2021", "lib.es2021.d.ts"], + ["es2022", "lib.es2022.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], @@ -72,12 +73,16 @@ namespace ts { ["es2021.string", "lib.es2021.string.d.ts"], ["es2021.weakref", "lib.es2021.weakref.d.ts"], ["es2021.intl", "lib.es2021.intl.d.ts"], - ["esnext.array", "lib.es2019.array.d.ts"], + ["es2022.array", "lib.es2022.array.d.ts"], + ["es2022.error", "lib.es2022.error.d.ts"], + ["es2022.object", "lib.es2022.object.d.ts"], + ["es2022.string", "lib.es2022.string.d.ts"], + ["esnext.array", "lib.es2022.array.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], - ["esnext.string", "lib.es2021.string.d.ts"], + ["esnext.string", "lib.es2022.string.d.ts"], ["esnext.promise", "lib.es2021.promise.d.ts"], ["esnext.weakref", "lib.es2021.weakref.d.ts"] ]; @@ -314,6 +319,7 @@ namespace ts { es2019: ScriptTarget.ES2019, es2020: ScriptTarget.ES2020, es2021: ScriptTarget.ES2021, + es2022: ScriptTarget.ES2022, esnext: ScriptTarget.ESNext, })), affectsSourceFile: true, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6c7cb7b5187c6..49da1c5b457c9 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6256,6 +6256,7 @@ namespace ts { ES2019 = 6, ES2020 = 7, ES2021 = 8, + ES2022 = 9, ESNext = 99, JSON = 100, Latest = ESNext, @@ -6713,15 +6714,16 @@ namespace ts { ContainsTypeScript = 1 << 0, ContainsJsx = 1 << 1, ContainsESNext = 1 << 2, - ContainsES2021 = 1 << 3, - ContainsES2020 = 1 << 4, - ContainsES2019 = 1 << 5, - ContainsES2018 = 1 << 6, - ContainsES2017 = 1 << 7, - ContainsES2016 = 1 << 8, - ContainsES2015 = 1 << 9, - ContainsGenerator = 1 << 10, - ContainsDestructuringAssignment = 1 << 11, + ContainsES2022 = 1 << 3, + ContainsES2021 = 1 << 4, + ContainsES2020 = 1 << 5, + ContainsES2019 = 1 << 6, + ContainsES2018 = 1 << 7, + ContainsES2017 = 1 << 8, + ContainsES2016 = 1 << 9, + ContainsES2015 = 1 << 10, + ContainsGenerator = 1 << 11, + ContainsDestructuringAssignment = 1 << 12, // Markers // - Flags used to indicate that a subtree contains a specific transformation. @@ -6750,6 +6752,7 @@ namespace ts { AssertTypeScript = ContainsTypeScript, AssertJsx = ContainsJsx, AssertESNext = ContainsESNext, + AssertES2022 = ContainsES2022, AssertES2021 = ContainsES2021, AssertES2020 = ContainsES2020, AssertES2019 = ContainsES2019, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 82015d6148e04..06afd288e9ab8 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -606,6 +606,7 @@ namespace ts { AsyncIterableIterator: emptyArray, AsyncGenerator: emptyArray, AsyncGeneratorFunction: emptyArray, + NumberFormat: ["formatToParts"] }, es2019: { Array: ["flat", "flatMap"], @@ -627,8 +628,21 @@ namespace ts { PromiseConstructor: ["any"], String: ["replaceAll"] }, - esnext: { - NumberFormat: ["formatToParts"] + es2022: { + Array: ["at"], + String: ["at"], + Int8Array: ["at"], + Uint8Array: ["at"], + Uint8ClampedArray: ["at"], + Int16Array: ["at"], + Uint16Array: ["at"], + Int32Array: ["at"], + Uint32Array: ["at"], + Float32Array: ["at"], + Float64Array: ["at"], + BigInt64Array: ["at"], + BigUint64Array: ["at"], + ObjectConstructor: ["hasOwn"] } }; } diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index d638ec32a8270..8f834e5e45971 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -14,6 +14,8 @@ namespace ts { switch (getEmitScriptTarget(options)) { case ScriptTarget.ESNext: return "lib.esnext.full.d.ts"; + case ScriptTarget.ES2022: + return "lib.es2022.full.d.ts"; case ScriptTarget.ES2021: return "lib.es2021.full.d.ts"; case ScriptTarget.ES2020: diff --git a/src/lib/es2022.array.d.ts b/src/lib/es2022.array.d.ts new file mode 100644 index 0000000000000..2c68a99c91e1f --- /dev/null +++ b/src/lib/es2022.array.d.ts @@ -0,0 +1,103 @@ +interface Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): T | undefined; +} + +interface ReadonlyArray { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): T | undefined; +} + +interface Int8Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Uint8Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Uint8ClampedArray { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Int16Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Uint16Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Int32Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Uint32Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Float32Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface Float64Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface BigInt64Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} + +interface BigUint64Array { + /** + * Returns the item located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): number | undefined; +} diff --git a/src/lib/es2022.d.ts b/src/lib/es2022.d.ts new file mode 100644 index 0000000000000..67a9199b5d6f4 --- /dev/null +++ b/src/lib/es2022.d.ts @@ -0,0 +1,5 @@ +/// +/// +/// +/// +/// diff --git a/src/lib/es2022.error.d.ts b/src/lib/es2022.error.d.ts new file mode 100644 index 0000000000000..20927134e3536 --- /dev/null +++ b/src/lib/es2022.error.d.ts @@ -0,0 +1,8 @@ +interface ErrorOptions { + cause?: Error; +} + +interface ErrorConstructor { + new(message?: string, options?: ErrorOptions): Error; + (message?: string, options?: ErrorOptions): Error; +} diff --git a/src/lib/es2022.full.d.ts b/src/lib/es2022.full.d.ts new file mode 100644 index 0000000000000..f7a8fdc84c167 --- /dev/null +++ b/src/lib/es2022.full.d.ts @@ -0,0 +1,5 @@ +/// +/// +/// +/// +/// diff --git a/src/lib/es2022.object.d.ts b/src/lib/es2022.object.d.ts new file mode 100644 index 0000000000000..764610213b6ac --- /dev/null +++ b/src/lib/es2022.object.d.ts @@ -0,0 +1,8 @@ +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param o An object. + * @param v A property name. + */ + hasOwn(o: object, v: PropertyKey): boolean; +} diff --git a/src/lib/es2022.string.d.ts b/src/lib/es2022.string.d.ts new file mode 100644 index 0000000000000..23f4a0123f269 --- /dev/null +++ b/src/lib/es2022.string.d.ts @@ -0,0 +1,7 @@ +interface String { + /** + * Returns a new String consisting of the single UTF-16 code unit located at the specified index. + * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. + */ + at(index: number): string | undefined; +} diff --git a/src/lib/esnext.d.ts b/src/lib/esnext.d.ts index 4a3ac819c1900..6735ced8f7367 100644 --- a/src/lib/esnext.d.ts +++ b/src/lib/esnext.d.ts @@ -1,2 +1,2 @@ -/// +/// /// diff --git a/src/lib/libs.json b/src/lib/libs.json index 4131d45171b23..e4434e89ea64a 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -9,6 +9,7 @@ "es2019", "es2020", "es2021", + "es2022", "esnext", // Host only "dom.generated", @@ -52,6 +53,10 @@ "es2021.promise", "es2021.weakref", "es2021.intl", + "es2022.array", + "es2022.error", + "es2022.object", + "es2022.string", "esnext.intl", // Default libraries "es5.full", @@ -62,6 +67,7 @@ "es2019.full", "es2020.full", "es2021.full", + "es2022.full", "esnext.full" ], "paths": { diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 67d6fda2a3b1b..d52148154a064 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -3509,6 +3509,7 @@ namespace ts.server.protocol { ES2019 = "ES2019", ES2020 = "ES2020", ES2021 = "ES2021", + ES2022 = "ES2022", ESNext = "ESNext" } diff --git a/src/testRunner/unittests/config/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts index 9739b3245831f..34644a0976640 100644 --- a/src/testRunner/unittests/config/commandLineParsing.ts +++ b/src/testRunner/unittests/config/commandLineParsing.ts @@ -211,7 +211,7 @@ namespace ts { start: undefined, length: undefined, }, { - messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'esnext'.", + messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 116be4316f918..e83a52b24a8e8 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3078,6 +3078,7 @@ declare namespace ts { ES2019 = 6, ES2020 = 7, ES2021 = 8, + ES2022 = 9, ESNext = 99, JSON = 100, Latest = 99 @@ -9658,6 +9659,7 @@ declare namespace ts.server.protocol { ES2019 = "ES2019", ES2020 = "ES2020", ES2021 = "ES2021", + ES2022 = "ES2022", ESNext = "ESNext" } enum ClassificationType { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 56d764c664c5d..f4100c356ff9a 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3078,6 +3078,7 @@ declare namespace ts { ES2019 = 6, ES2020 = 7, ES2021 = 8, + ES2022 = 9, ESNext = 99, JSON = 100, Latest = 99 diff --git a/tests/baselines/reference/callChainWithSuper(target=es2022).js b/tests/baselines/reference/callChainWithSuper(target=es2022).js new file mode 100644 index 0000000000000..30e1ad3886dc5 --- /dev/null +++ b/tests/baselines/reference/callChainWithSuper(target=es2022).js @@ -0,0 +1,18 @@ +//// [callChainWithSuper.ts] +// GH#34952 +class Base { method?() {} } +class Derived extends Base { + method1() { return super.method?.(); } + method2() { return super["method"]?.(); } +} + +//// [callChainWithSuper.js] +"use strict"; +// GH#34952 +class Base { + method() { } +} +class Derived extends Base { + method1() { return super.method?.(); } + method2() { return super["method"]?.(); } +} diff --git a/tests/baselines/reference/callWithSpread4.symbols b/tests/baselines/reference/callWithSpread4.symbols index dbb7576582895..428f41b17c340 100644 --- a/tests/baselines/reference/callWithSpread4.symbols +++ b/tests/baselines/reference/callWithSpread4.symbols @@ -30,7 +30,7 @@ declare const pli: { (streams: ReadonlyArray): Promise; >streams : Symbol(streams, Decl(callWithSpread4.ts, 5, 5)) ->ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --) ... and 1 more) >R : Symbol(R, Decl(callWithSpread4.ts, 0, 0)) >W : Symbol(W, Decl(callWithSpread4.ts, 0, 22)) >RW : Symbol(RW, Decl(callWithSpread4.ts, 1, 22)) @@ -43,7 +43,7 @@ declare const pli: { >RW : Symbol(RW, Decl(callWithSpread4.ts, 1, 22)) >W : Symbol(W, Decl(callWithSpread4.ts, 0, 22)) >streams : Symbol(streams, Decl(callWithSpread4.ts, 6, 23)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >RW : Symbol(RW, Decl(callWithSpread4.ts, 1, 22)) >W : Symbol(W, Decl(callWithSpread4.ts, 0, 22)) >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, --, --), Decl(lib.es2018.promise.d.ts, --, --)) diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt index ee42a781a6366..3e7a58d4b942f 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt @@ -16,7 +16,7 @@ tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(20,27): err tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(21,35): error TS2583: Cannot find name 'AsyncGeneratorFunction'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(22,26): error TS2583: Cannot find name 'AsyncIterable'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(23,34): error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. -tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(24,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. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(24,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 'es2018' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(27,26): error TS2550: Property 'flat' does not exist on type 'undefined[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2019' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(28,29): error TS2550: Property 'flatMap' does not exist on type 'undefined[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2019' or later. tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(29,49): error TS2550: Property 'fromEntries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2019' or later. @@ -95,7 +95,7 @@ tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): err !!! error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); ~~~~~~~~~~~~~ -!!! 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. +!!! 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 'es2018' or later. // es2019 const testArrayFlat = [].flat(); diff --git a/tests/baselines/reference/errorCause(target=es2021).errors.txt b/tests/baselines/reference/errorCause(target=es2021).errors.txt new file mode 100644 index 0000000000000..4cac6368fccb4 --- /dev/null +++ b/tests/baselines/reference/errorCause(target=es2021).errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/errorCause.ts(1,18): error TS2554: Expected 0-1 arguments, but got 2. + + +==== tests/cases/compiler/errorCause.ts (1 errors) ==== + new Error("foo", { cause: new Error("bar") }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 0-1 arguments, but got 2. + \ No newline at end of file diff --git a/tests/baselines/reference/errorCause(target=es2021).js b/tests/baselines/reference/errorCause(target=es2021).js new file mode 100644 index 0000000000000..24432cbe9625b --- /dev/null +++ b/tests/baselines/reference/errorCause(target=es2021).js @@ -0,0 +1,6 @@ +//// [errorCause.ts] +new Error("foo", { cause: new Error("bar") }); + + +//// [errorCause.js] +new Error("foo", { cause: new Error("bar") }); diff --git a/tests/baselines/reference/errorCause(target=es2021).symbols b/tests/baselines/reference/errorCause(target=es2021).symbols new file mode 100644 index 0000000000000..0fe6616b0a8b7 --- /dev/null +++ b/tests/baselines/reference/errorCause(target=es2021).symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/errorCause.ts === +new Error("foo", { cause: new Error("bar") }); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>cause : Symbol(cause, Decl(errorCause.ts, 0, 18)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/errorCause(target=es2021).types b/tests/baselines/reference/errorCause(target=es2021).types new file mode 100644 index 0000000000000..e92889262730c --- /dev/null +++ b/tests/baselines/reference/errorCause(target=es2021).types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/errorCause.ts === +new Error("foo", { cause: new Error("bar") }); +>new Error("foo", { cause: new Error("bar") }) : Error +>Error : ErrorConstructor +>"foo" : "foo" +>{ cause: new Error("bar") } : { cause: Error; } +>cause : Error +>new Error("bar") : Error +>Error : ErrorConstructor +>"bar" : "bar" + diff --git a/tests/baselines/reference/errorCause(target=es2022).js b/tests/baselines/reference/errorCause(target=es2022).js new file mode 100644 index 0000000000000..24432cbe9625b --- /dev/null +++ b/tests/baselines/reference/errorCause(target=es2022).js @@ -0,0 +1,6 @@ +//// [errorCause.ts] +new Error("foo", { cause: new Error("bar") }); + + +//// [errorCause.js] +new Error("foo", { cause: new Error("bar") }); diff --git a/tests/baselines/reference/errorCause(target=es2022).symbols b/tests/baselines/reference/errorCause(target=es2022).symbols new file mode 100644 index 0000000000000..0fe6616b0a8b7 --- /dev/null +++ b/tests/baselines/reference/errorCause(target=es2022).symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/errorCause.ts === +new Error("foo", { cause: new Error("bar") }); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>cause : Symbol(cause, Decl(errorCause.ts, 0, 18)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/errorCause(target=es2022).types b/tests/baselines/reference/errorCause(target=es2022).types new file mode 100644 index 0000000000000..e92889262730c --- /dev/null +++ b/tests/baselines/reference/errorCause(target=es2022).types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/errorCause.ts === +new Error("foo", { cause: new Error("bar") }); +>new Error("foo", { cause: new Error("bar") }) : Error +>Error : ErrorConstructor +>"foo" : "foo" +>{ cause: new Error("bar") } : { cause: Error; } +>cause : Error +>new Error("bar") : Error +>Error : ErrorConstructor +>"bar" : "bar" + diff --git a/tests/baselines/reference/errorCause(target=esnext).js b/tests/baselines/reference/errorCause(target=esnext).js new file mode 100644 index 0000000000000..24432cbe9625b --- /dev/null +++ b/tests/baselines/reference/errorCause(target=esnext).js @@ -0,0 +1,6 @@ +//// [errorCause.ts] +new Error("foo", { cause: new Error("bar") }); + + +//// [errorCause.js] +new Error("foo", { cause: new Error("bar") }); diff --git a/tests/baselines/reference/errorCause(target=esnext).symbols b/tests/baselines/reference/errorCause(target=esnext).symbols new file mode 100644 index 0000000000000..0fe6616b0a8b7 --- /dev/null +++ b/tests/baselines/reference/errorCause(target=esnext).symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/errorCause.ts === +new Error("foo", { cause: new Error("bar") }); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>cause : Symbol(cause, Decl(errorCause.ts, 0, 18)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/errorCause(target=esnext).types b/tests/baselines/reference/errorCause(target=esnext).types new file mode 100644 index 0000000000000..e92889262730c --- /dev/null +++ b/tests/baselines/reference/errorCause(target=esnext).types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/errorCause.ts === +new Error("foo", { cause: new Error("bar") }); +>new Error("foo", { cause: new Error("bar") }) : Error +>Error : ErrorConstructor +>"foo" : "foo" +>{ cause: new Error("bar") } : { cause: Error; } +>cause : Error +>new Error("bar") : Error +>Error : ErrorConstructor +>"bar" : "bar" + diff --git a/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.symbols b/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.symbols index be0559bfe5251..cf1ed59e66d6e 100644 --- a/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.symbols +++ b/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.symbols @@ -297,7 +297,7 @@ export class IterableWeakMap implements WeakMap { Object.defineProperties(IterableWeakMap.prototype, { >Object.defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.object.d.ts, --, --)) >defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) >IterableWeakMap.prototype : Symbol(IterableWeakMap.prototype) >IterableWeakMap : Symbol(IterableWeakMap, Decl(esNextWeakRefs_IterableWeakMap.ts, 6, 2)) @@ -322,7 +322,7 @@ Object.defineProperties(IterableWeakMap.prototype, { >value : Symbol(value, Decl(esNextWeakRefs_IterableWeakMap.ts, 89, 23)) >Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )!.value : Symbol(PropertyDescriptor.value, Decl(lib.es5.d.ts, --, --)) >Object.getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.object.d.ts, --, --)) >getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) IterableWeakMap.prototype, diff --git a/tests/baselines/reference/flatArrayNoExcessiveStackDepth.symbols b/tests/baselines/reference/flatArrayNoExcessiveStackDepth.symbols index 4b27f6006cbd7..bbd3083d04c40 100644 --- a/tests/baselines/reference/flatArrayNoExcessiveStackDepth.symbols +++ b/tests/baselines/reference/flatArrayNoExcessiveStackDepth.symbols @@ -15,7 +15,7 @@ const bar = foo.flatMap(bar => bar as Foo); interface Foo extends Array {} >Foo : Symbol(Foo, Decl(flatArrayNoExcessiveStackDepth.ts, 3, 43)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) // Repros from comments in #43249 diff --git a/tests/baselines/reference/importExportInternalComments.symbols b/tests/baselines/reference/importExportInternalComments.symbols index 87eeb2d31e9c9..e4c5f85d9bd77 100644 --- a/tests/baselines/reference/importExportInternalComments.symbols +++ b/tests/baselines/reference/importExportInternalComments.symbols @@ -4,7 +4,7 @@ declare module "foo"; === tests/cases/compiler/default.ts === /*1*/ export /*2*/ default /*3*/ Array /*4*/; ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) === tests/cases/compiler/index.ts === /*1*/ import /*2*/ D /*3*/, /*4*/ { /*5*/ A /*6*/, /*7*/ B /*8*/ as /*9*/ C /*10*/ } /*11*/ from /*12*/ "foo"; diff --git a/tests/baselines/reference/indexAt(target=es2021).errors.txt b/tests/baselines/reference/indexAt(target=es2021).errors.txt new file mode 100644 index 0000000000000..9307c2f7d5623 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=es2021).errors.txt @@ -0,0 +1,56 @@ +tests/cases/compiler/indexAt.ts(1,5): error TS2550: Property 'at' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(2,7): error TS2550: Property 'at' does not exist on type '"foo"'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(3,17): error TS2550: Property 'at' does not exist on type 'Int8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(4,18): error TS2550: Property 'at' does not exist on type 'Uint8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(5,25): error TS2550: Property 'at' does not exist on type 'Uint8ClampedArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(6,18): error TS2550: Property 'at' does not exist on type 'Int16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(7,19): error TS2550: Property 'at' does not exist on type 'Uint16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(8,18): error TS2550: Property 'at' does not exist on type 'Int32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(9,19): error TS2550: Property 'at' does not exist on type 'Uint32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(10,20): error TS2550: Property 'at' does not exist on type 'Float32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(11,20): error TS2550: Property 'at' does not exist on type 'Float64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(12,21): error TS2550: Property 'at' does not exist on type 'BigInt64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. +tests/cases/compiler/indexAt.ts(13,22): error TS2550: Property 'at' does not exist on type 'BigUint64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + + +==== tests/cases/compiler/indexAt.ts (13 errors) ==== + [0].at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + "foo".at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type '"foo"'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Int8Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Int8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Uint8Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Uint8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Uint8ClampedArray().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Uint8ClampedArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Int16Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Int16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Uint16Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Uint16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Int32Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Int32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Uint32Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Uint32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Float32Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Float32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new Float64Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'Float64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new BigInt64Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'BigInt64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + new BigUint64Array().at(0); + ~~ +!!! error TS2550: Property 'at' does not exist on type 'BigUint64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later. + \ No newline at end of file diff --git a/tests/baselines/reference/indexAt(target=es2021).js b/tests/baselines/reference/indexAt(target=es2021).js new file mode 100644 index 0000000000000..01ffbff491904 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=es2021).js @@ -0,0 +1,30 @@ +//// [indexAt.ts] +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +new Uint8Array().at(0); +new Uint8ClampedArray().at(0); +new Int16Array().at(0); +new Uint16Array().at(0); +new Int32Array().at(0); +new Uint32Array().at(0); +new Float32Array().at(0); +new Float64Array().at(0); +new BigInt64Array().at(0); +new BigUint64Array().at(0); + + +//// [indexAt.js] +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +new Uint8Array().at(0); +new Uint8ClampedArray().at(0); +new Int16Array().at(0); +new Uint16Array().at(0); +new Int32Array().at(0); +new Uint32Array().at(0); +new Float32Array().at(0); +new Float64Array().at(0); +new BigInt64Array().at(0); +new BigUint64Array().at(0); diff --git a/tests/baselines/reference/indexAt(target=es2021).symbols b/tests/baselines/reference/indexAt(target=es2021).symbols new file mode 100644 index 0000000000000..383f372fadd3e --- /dev/null +++ b/tests/baselines/reference/indexAt(target=es2021).symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/indexAt.ts === +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Uint8Array().at(0); +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Uint8ClampedArray().at(0); +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Int16Array().at(0); +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Uint16Array().at(0); +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Int32Array().at(0); +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Uint32Array().at(0); +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Float32Array().at(0); +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new Float64Array().at(0); +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --)) + +new BigInt64Array().at(0); +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +new BigUint64Array().at(0); +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + diff --git a/tests/baselines/reference/indexAt(target=es2021).types b/tests/baselines/reference/indexAt(target=es2021).types new file mode 100644 index 0000000000000..8229bcacb9328 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=es2021).types @@ -0,0 +1,104 @@ +=== tests/cases/compiler/indexAt.ts === +[0].at(0); +>[0].at(0) : any +>[0].at : any +>[0] : number[] +>0 : 0 +>at : any +>0 : 0 + +"foo".at(0); +>"foo".at(0) : any +>"foo".at : any +>"foo" : "foo" +>at : any +>0 : 0 + +new Int8Array().at(0); +>new Int8Array().at(0) : any +>new Int8Array().at : any +>new Int8Array() : Int8Array +>Int8Array : Int8ArrayConstructor +>at : any +>0 : 0 + +new Uint8Array().at(0); +>new Uint8Array().at(0) : any +>new Uint8Array().at : any +>new Uint8Array() : Uint8Array +>Uint8Array : Uint8ArrayConstructor +>at : any +>0 : 0 + +new Uint8ClampedArray().at(0); +>new Uint8ClampedArray().at(0) : any +>new Uint8ClampedArray().at : any +>new Uint8ClampedArray() : Uint8ClampedArray +>Uint8ClampedArray : Uint8ClampedArrayConstructor +>at : any +>0 : 0 + +new Int16Array().at(0); +>new Int16Array().at(0) : any +>new Int16Array().at : any +>new Int16Array() : Int16Array +>Int16Array : Int16ArrayConstructor +>at : any +>0 : 0 + +new Uint16Array().at(0); +>new Uint16Array().at(0) : any +>new Uint16Array().at : any +>new Uint16Array() : Uint16Array +>Uint16Array : Uint16ArrayConstructor +>at : any +>0 : 0 + +new Int32Array().at(0); +>new Int32Array().at(0) : any +>new Int32Array().at : any +>new Int32Array() : Int32Array +>Int32Array : Int32ArrayConstructor +>at : any +>0 : 0 + +new Uint32Array().at(0); +>new Uint32Array().at(0) : any +>new Uint32Array().at : any +>new Uint32Array() : Uint32Array +>Uint32Array : Uint32ArrayConstructor +>at : any +>0 : 0 + +new Float32Array().at(0); +>new Float32Array().at(0) : any +>new Float32Array().at : any +>new Float32Array() : Float32Array +>Float32Array : Float32ArrayConstructor +>at : any +>0 : 0 + +new Float64Array().at(0); +>new Float64Array().at(0) : any +>new Float64Array().at : any +>new Float64Array() : Float64Array +>Float64Array : Float64ArrayConstructor +>at : any +>0 : 0 + +new BigInt64Array().at(0); +>new BigInt64Array().at(0) : any +>new BigInt64Array().at : any +>new BigInt64Array() : BigInt64Array +>BigInt64Array : BigInt64ArrayConstructor +>at : any +>0 : 0 + +new BigUint64Array().at(0); +>new BigUint64Array().at(0) : any +>new BigUint64Array().at : any +>new BigUint64Array() : BigUint64Array +>BigUint64Array : BigUint64ArrayConstructor +>at : any +>0 : 0 + diff --git a/tests/baselines/reference/indexAt(target=es2022).js b/tests/baselines/reference/indexAt(target=es2022).js new file mode 100644 index 0000000000000..01ffbff491904 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=es2022).js @@ -0,0 +1,30 @@ +//// [indexAt.ts] +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +new Uint8Array().at(0); +new Uint8ClampedArray().at(0); +new Int16Array().at(0); +new Uint16Array().at(0); +new Int32Array().at(0); +new Uint32Array().at(0); +new Float32Array().at(0); +new Float64Array().at(0); +new BigInt64Array().at(0); +new BigUint64Array().at(0); + + +//// [indexAt.js] +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +new Uint8Array().at(0); +new Uint8ClampedArray().at(0); +new Int16Array().at(0); +new Uint16Array().at(0); +new Int32Array().at(0); +new Uint32Array().at(0); +new Float32Array().at(0); +new Float64Array().at(0); +new BigInt64Array().at(0); +new BigUint64Array().at(0); diff --git a/tests/baselines/reference/indexAt(target=es2022).symbols b/tests/baselines/reference/indexAt(target=es2022).symbols new file mode 100644 index 0000000000000..09b7425331f42 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=es2022).symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/indexAt.ts === +[0].at(0); +>[0].at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +"foo".at(0); +>"foo".at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) +>at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) + +new Int8Array().at(0); +>new Int8Array().at : Symbol(Int8Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Int8Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint8Array().at(0); +>new Uint8Array().at : Symbol(Uint8Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint8Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint8ClampedArray().at(0); +>new Uint8ClampedArray().at : Symbol(Uint8ClampedArray.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint8ClampedArray.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Int16Array().at(0); +>new Int16Array().at : Symbol(Int16Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Int16Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint16Array().at(0); +>new Uint16Array().at : Symbol(Uint16Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint16Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Int32Array().at(0); +>new Int32Array().at : Symbol(Int32Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Int32Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint32Array().at(0); +>new Uint32Array().at : Symbol(Uint32Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint32Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Float32Array().at(0); +>new Float32Array().at : Symbol(Float32Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Float32Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Float64Array().at(0); +>new Float64Array().at : Symbol(Float64Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Float64Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new BigInt64Array().at(0); +>new BigInt64Array().at : Symbol(BigInt64Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(BigInt64Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new BigUint64Array().at(0); +>new BigUint64Array().at : Symbol(BigUint64Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(BigUint64Array.at, Decl(lib.es2022.array.d.ts, --, --)) + diff --git a/tests/baselines/reference/indexAt(target=es2022).types b/tests/baselines/reference/indexAt(target=es2022).types new file mode 100644 index 0000000000000..36fbb503e4258 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=es2022).types @@ -0,0 +1,104 @@ +=== tests/cases/compiler/indexAt.ts === +[0].at(0); +>[0].at(0) : number +>[0].at : (index: number) => number +>[0] : number[] +>0 : 0 +>at : (index: number) => number +>0 : 0 + +"foo".at(0); +>"foo".at(0) : string +>"foo".at : (index: number) => string +>"foo" : "foo" +>at : (index: number) => string +>0 : 0 + +new Int8Array().at(0); +>new Int8Array().at(0) : number +>new Int8Array().at : (index: number) => number +>new Int8Array() : Int8Array +>Int8Array : Int8ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint8Array().at(0); +>new Uint8Array().at(0) : number +>new Uint8Array().at : (index: number) => number +>new Uint8Array() : Uint8Array +>Uint8Array : Uint8ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint8ClampedArray().at(0); +>new Uint8ClampedArray().at(0) : number +>new Uint8ClampedArray().at : (index: number) => number +>new Uint8ClampedArray() : Uint8ClampedArray +>Uint8ClampedArray : Uint8ClampedArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Int16Array().at(0); +>new Int16Array().at(0) : number +>new Int16Array().at : (index: number) => number +>new Int16Array() : Int16Array +>Int16Array : Int16ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint16Array().at(0); +>new Uint16Array().at(0) : number +>new Uint16Array().at : (index: number) => number +>new Uint16Array() : Uint16Array +>Uint16Array : Uint16ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Int32Array().at(0); +>new Int32Array().at(0) : number +>new Int32Array().at : (index: number) => number +>new Int32Array() : Int32Array +>Int32Array : Int32ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint32Array().at(0); +>new Uint32Array().at(0) : number +>new Uint32Array().at : (index: number) => number +>new Uint32Array() : Uint32Array +>Uint32Array : Uint32ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Float32Array().at(0); +>new Float32Array().at(0) : number +>new Float32Array().at : (index: number) => number +>new Float32Array() : Float32Array +>Float32Array : Float32ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Float64Array().at(0); +>new Float64Array().at(0) : number +>new Float64Array().at : (index: number) => number +>new Float64Array() : Float64Array +>Float64Array : Float64ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new BigInt64Array().at(0); +>new BigInt64Array().at(0) : number +>new BigInt64Array().at : (index: number) => number +>new BigInt64Array() : BigInt64Array +>BigInt64Array : BigInt64ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new BigUint64Array().at(0); +>new BigUint64Array().at(0) : number +>new BigUint64Array().at : (index: number) => number +>new BigUint64Array() : BigUint64Array +>BigUint64Array : BigUint64ArrayConstructor +>at : (index: number) => number +>0 : 0 + diff --git a/tests/baselines/reference/indexAt(target=esnext).js b/tests/baselines/reference/indexAt(target=esnext).js new file mode 100644 index 0000000000000..01ffbff491904 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=esnext).js @@ -0,0 +1,30 @@ +//// [indexAt.ts] +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +new Uint8Array().at(0); +new Uint8ClampedArray().at(0); +new Int16Array().at(0); +new Uint16Array().at(0); +new Int32Array().at(0); +new Uint32Array().at(0); +new Float32Array().at(0); +new Float64Array().at(0); +new BigInt64Array().at(0); +new BigUint64Array().at(0); + + +//// [indexAt.js] +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +new Uint8Array().at(0); +new Uint8ClampedArray().at(0); +new Int16Array().at(0); +new Uint16Array().at(0); +new Int32Array().at(0); +new Uint32Array().at(0); +new Float32Array().at(0); +new Float64Array().at(0); +new BigInt64Array().at(0); +new BigUint64Array().at(0); diff --git a/tests/baselines/reference/indexAt(target=esnext).symbols b/tests/baselines/reference/indexAt(target=esnext).symbols new file mode 100644 index 0000000000000..09b7425331f42 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=esnext).symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/indexAt.ts === +[0].at(0); +>[0].at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +"foo".at(0); +>"foo".at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) +>at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) + +new Int8Array().at(0); +>new Int8Array().at : Symbol(Int8Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Int8Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint8Array().at(0); +>new Uint8Array().at : Symbol(Uint8Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint8Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint8ClampedArray().at(0); +>new Uint8ClampedArray().at : Symbol(Uint8ClampedArray.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint8ClampedArray.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Int16Array().at(0); +>new Int16Array().at : Symbol(Int16Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Int16Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint16Array().at(0); +>new Uint16Array().at : Symbol(Uint16Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint16Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Int32Array().at(0); +>new Int32Array().at : Symbol(Int32Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Int32Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Uint32Array().at(0); +>new Uint32Array().at : Symbol(Uint32Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Uint32Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Float32Array().at(0); +>new Float32Array().at : Symbol(Float32Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Float32Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new Float64Array().at(0); +>new Float64Array().at : Symbol(Float64Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more) +>at : Symbol(Float64Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new BigInt64Array().at(0); +>new BigInt64Array().at : Symbol(BigInt64Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(BigInt64Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +new BigUint64Array().at(0); +>new BigUint64Array().at : Symbol(BigUint64Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(BigUint64Array.at, Decl(lib.es2022.array.d.ts, --, --)) + diff --git a/tests/baselines/reference/indexAt(target=esnext).types b/tests/baselines/reference/indexAt(target=esnext).types new file mode 100644 index 0000000000000..36fbb503e4258 --- /dev/null +++ b/tests/baselines/reference/indexAt(target=esnext).types @@ -0,0 +1,104 @@ +=== tests/cases/compiler/indexAt.ts === +[0].at(0); +>[0].at(0) : number +>[0].at : (index: number) => number +>[0] : number[] +>0 : 0 +>at : (index: number) => number +>0 : 0 + +"foo".at(0); +>"foo".at(0) : string +>"foo".at : (index: number) => string +>"foo" : "foo" +>at : (index: number) => string +>0 : 0 + +new Int8Array().at(0); +>new Int8Array().at(0) : number +>new Int8Array().at : (index: number) => number +>new Int8Array() : Int8Array +>Int8Array : Int8ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint8Array().at(0); +>new Uint8Array().at(0) : number +>new Uint8Array().at : (index: number) => number +>new Uint8Array() : Uint8Array +>Uint8Array : Uint8ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint8ClampedArray().at(0); +>new Uint8ClampedArray().at(0) : number +>new Uint8ClampedArray().at : (index: number) => number +>new Uint8ClampedArray() : Uint8ClampedArray +>Uint8ClampedArray : Uint8ClampedArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Int16Array().at(0); +>new Int16Array().at(0) : number +>new Int16Array().at : (index: number) => number +>new Int16Array() : Int16Array +>Int16Array : Int16ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint16Array().at(0); +>new Uint16Array().at(0) : number +>new Uint16Array().at : (index: number) => number +>new Uint16Array() : Uint16Array +>Uint16Array : Uint16ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Int32Array().at(0); +>new Int32Array().at(0) : number +>new Int32Array().at : (index: number) => number +>new Int32Array() : Int32Array +>Int32Array : Int32ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Uint32Array().at(0); +>new Uint32Array().at(0) : number +>new Uint32Array().at : (index: number) => number +>new Uint32Array() : Uint32Array +>Uint32Array : Uint32ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Float32Array().at(0); +>new Float32Array().at(0) : number +>new Float32Array().at : (index: number) => number +>new Float32Array() : Float32Array +>Float32Array : Float32ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new Float64Array().at(0); +>new Float64Array().at(0) : number +>new Float64Array().at : (index: number) => number +>new Float64Array() : Float64Array +>Float64Array : Float64ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new BigInt64Array().at(0); +>new BigInt64Array().at(0) : number +>new BigInt64Array().at : (index: number) => number +>new BigInt64Array() : BigInt64Array +>BigInt64Array : BigInt64ArrayConstructor +>at : (index: number) => number +>0 : 0 + +new BigUint64Array().at(0); +>new BigUint64Array().at(0) : number +>new BigUint64Array().at : (index: number) => number +>new BigUint64Array() : BigUint64Array +>BigUint64Array : BigUint64ArrayConstructor +>at : (index: number) => number +>0 : 0 + diff --git a/tests/baselines/reference/inferenceOptionalPropertiesToIndexSignatures.symbols b/tests/baselines/reference/inferenceOptionalPropertiesToIndexSignatures.symbols index 9874e516a2b75..72d4478539d77 100644 --- a/tests/baselines/reference/inferenceOptionalPropertiesToIndexSignatures.symbols +++ b/tests/baselines/reference/inferenceOptionalPropertiesToIndexSignatures.symbols @@ -72,7 +72,7 @@ const query = Object.entries(obj).map( >Object.entries(obj).map( ([k, v]) => `${k}=${encodeURIComponent(v)}`).join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) >Object.entries(obj).map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.object.d.ts, --, --)) >entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) >obj : Symbol(obj, Decl(inferenceOptionalPropertiesToIndexSignatures.ts, 16, 5)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/keyofAndIndexedAccess2.symbols b/tests/baselines/reference/keyofAndIndexedAccess2.symbols index 1c3758c137d3e..a17aafe571aa5 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess2.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccess2.symbols @@ -440,9 +440,9 @@ function fn} | {elements: Array}>(par >fn : Symbol(fn, Decl(keyofAndIndexedAccess2.ts, 115, 69)) >T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 119, 12)) >elements : Symbol(elements, Decl(keyofAndIndexedAccess2.ts, 119, 23)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >elements : Symbol(elements, Decl(keyofAndIndexedAccess2.ts, 119, 51)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >param : Symbol(param, Decl(keyofAndIndexedAccess2.ts, 119, 77)) >T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 119, 12)) >cb : Symbol(cb, Decl(keyofAndIndexedAccess2.ts, 119, 86)) @@ -459,7 +459,7 @@ function fn} | {elements: Array}>(par function fn2>(param: T, cb: (element: T[number]) => void) { >fn2 : Symbol(fn2, Decl(keyofAndIndexedAccess2.ts, 121, 1)) >T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 123, 13)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >param : Symbol(param, Decl(keyofAndIndexedAccess2.ts, 123, 38)) >T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 123, 13)) >cb : Symbol(cb, Decl(keyofAndIndexedAccess2.ts, 123, 47)) @@ -476,7 +476,7 @@ function fn2>(param: T, cb: (element: T[number]) => void function fn3>(param: T, cb: (element: T[number]) => void) { >fn3 : Symbol(fn3, Decl(keyofAndIndexedAccess2.ts, 125, 1)) >T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 129, 13)) ->ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --) ... and 1 more) >param : Symbol(param, Decl(keyofAndIndexedAccess2.ts, 129, 46)) >T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 129, 13)) >cb : Symbol(cb, Decl(keyofAndIndexedAccess2.ts, 129, 55)) @@ -494,12 +494,12 @@ function fn4() { let x: Array[K] = 'abc'; >x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 134, 7)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 133, 13)) let y: ReadonlyArray[K] = 'abc'; >y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 135, 7)) ->ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --) ... and 1 more) >K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 133, 13)) } diff --git a/tests/baselines/reference/noIterationTypeErrorsInCFA.symbols b/tests/baselines/reference/noIterationTypeErrorsInCFA.symbols index 3498f52d456f3..60040c3ed17c4 100644 --- a/tests/baselines/reference/noIterationTypeErrorsInCFA.symbols +++ b/tests/baselines/reference/noIterationTypeErrorsInCFA.symbols @@ -13,7 +13,7 @@ export function doRemove(dds: F | F[]) { if (!Array.isArray(dds)) { >Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) >dds : Symbol(dds, Decl(noIterationTypeErrorsInCFA.ts, 3, 25)) diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json index 00597f669b34b..ed76bdb1760bc 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json @@ -131,5 +131,15 @@ "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json index 02a5d6a429932..7d2a5308b9e8b 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json @@ -125,5 +125,15 @@ "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/recursiveConditionalTypes.symbols b/tests/baselines/reference/recursiveConditionalTypes.symbols index 3c77d93e71f13..e9b58df3c28a3 100644 --- a/tests/baselines/reference/recursiveConditionalTypes.symbols +++ b/tests/baselines/reference/recursiveConditionalTypes.symbols @@ -566,7 +566,7 @@ let five: Add<2, 3>; type _PrependNextNum> = A['length'] extends infer T >_PrependNextNum : Symbol(_PrependNextNum, Decl(recursiveConditionalTypes.ts, 147, 20)) >A : Symbol(A, Decl(recursiveConditionalTypes.ts, 151, 21)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >A : Symbol(A, Decl(recursiveConditionalTypes.ts, 151, 21)) >T : Symbol(T, Decl(recursiveConditionalTypes.ts, 151, 74)) @@ -584,7 +584,7 @@ type _PrependNextNum> = A['length'] extends infer T type _Enumerate, N extends number> = N extends A['length'] >_Enumerate : Symbol(_Enumerate, Decl(recursiveConditionalTypes.ts, 155, 12)) >A : Symbol(A, Decl(recursiveConditionalTypes.ts, 157, 16)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >N : Symbol(N, Decl(recursiveConditionalTypes.ts, 157, 41)) >N : Symbol(N, Decl(recursiveConditionalTypes.ts, 157, 41)) >A : Symbol(A, Decl(recursiveConditionalTypes.ts, 157, 16)) diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols index 4cd6dce23e368..f37166423f17c 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols @@ -5,7 +5,7 @@ declare function f(strs: TemplateStringsArray, ...callbacks: Array<(x: T) => >strs : Symbol(strs, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 22)) >TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) >callbacks : Symbol(callbacks, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 49)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >x : Symbol(x, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 71)) >T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 19)) diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js index 100d910dfbaba..01d07f61429b4 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js @@ -68,7 +68,7 @@ default: true --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library declarations. -one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext +one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext default: ES3 --module, -m @@ -77,7 +77,7 @@ one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, n --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref +one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, es2022.array, es2022.error, es2022.object, es2022.string, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref --allowJs Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 3b4922b2fe603..4db9e7df4d352 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -68,7 +68,7 @@ default: true --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library declarations. -one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext +one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext default: ES3 --module, -m @@ -77,7 +77,7 @@ one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, n --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref +one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, es2022.array, es2022.error, es2022.object, es2022.string, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref --allowJs Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 3b4922b2fe603..4db9e7df4d352 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -68,7 +68,7 @@ default: true --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library declarations. -one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext +one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext default: ES3 --module, -m @@ -77,7 +77,7 @@ one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, n --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref +one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, es2022.array, es2022.error, es2022.object, es2022.string, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref --allowJs Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. diff --git a/tests/baselines/reference/typeGuardConstructorNarrowAny.symbols b/tests/baselines/reference/typeGuardConstructorNarrowAny.symbols index acbc179aa270d..980e68c3f1cf9 100644 --- a/tests/baselines/reference/typeGuardConstructorNarrowAny.symbols +++ b/tests/baselines/reference/typeGuardConstructorNarrowAny.symbols @@ -5,7 +5,7 @@ let var1: any; if (var1.constructor === String) { >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 5 more) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 6 more) var1; // String >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) @@ -26,7 +26,7 @@ if (var1.constructor === Boolean) { } if (var1.constructor === Array) { >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) var1; // any[] >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) diff --git a/tests/baselines/reference/typeGuardConstructorPrimitiveTypes.symbols b/tests/baselines/reference/typeGuardConstructorPrimitiveTypes.symbols index 1bcc2f586eb5e..7258c198d18f7 100644 --- a/tests/baselines/reference/typeGuardConstructorPrimitiveTypes.symbols +++ b/tests/baselines/reference/typeGuardConstructorPrimitiveTypes.symbols @@ -7,7 +7,7 @@ if (var1.constructor === String) { >var1.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) >constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 5 more) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 6 more) var1; // string >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) @@ -34,7 +34,7 @@ if (var1.constructor === Array) { >var1.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) >constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 2 more) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) var1; // any[] >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) @@ -61,7 +61,7 @@ if (var1.constructor === BigInt) { // Narrow a union of primitive object types let var2: String | Number | Boolean | Symbol | BigInt; >var2 : Symbol(var2, Decl(typeGuardConstructorPrimitiveTypes.ts, 22, 3)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 5 more) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 6 more) >Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) @@ -71,7 +71,7 @@ if (var2.constructor === String) { >var2.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >var2 : Symbol(var2, Decl(typeGuardConstructorPrimitiveTypes.ts, 22, 3)) >constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 5 more) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 6 more) var2; // String >var2 : Symbol(var2, Decl(typeGuardConstructorPrimitiveTypes.ts, 22, 3)) diff --git a/tests/baselines/reference/unionTypeInference.symbols b/tests/baselines/reference/unionTypeInference.symbols index 11fdc52396485..a4a24b15ebfcc 100644 --- a/tests/baselines/reference/unionTypeInference.symbols +++ b/tests/baselines/reference/unionTypeInference.symbols @@ -230,7 +230,7 @@ async function fun(deepPromised: DeepPromised) { for (const value of Object.values(deepPromisedWithIndexer)) { >value : Symbol(value, Decl(unionTypeInference.ts, 62, 14)) >Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.object.d.ts, --, --)) >values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) >deepPromisedWithIndexer : Symbol(deepPromisedWithIndexer, Decl(unionTypeInference.ts, 61, 9)) diff --git a/tests/cases/compiler/errorCause.ts b/tests/cases/compiler/errorCause.ts new file mode 100644 index 0000000000000..c04ce180bff35 --- /dev/null +++ b/tests/cases/compiler/errorCause.ts @@ -0,0 +1,3 @@ +// @target: es2021, es2022, esnext + +new Error("foo", { cause: new Error("bar") }); diff --git a/tests/cases/compiler/indexAt.ts b/tests/cases/compiler/indexAt.ts new file mode 100644 index 0000000000000..d41117903a5b1 --- /dev/null +++ b/tests/cases/compiler/indexAt.ts @@ -0,0 +1,15 @@ +// @target: es2021, es2022, esnext + +[0].at(0); +"foo".at(0); +new Int8Array().at(0); +new Uint8Array().at(0); +new Uint8ClampedArray().at(0); +new Int16Array().at(0); +new Uint16Array().at(0); +new Int32Array().at(0); +new Uint32Array().at(0); +new Float32Array().at(0); +new Float64Array().at(0); +new BigInt64Array().at(0); +new BigUint64Array().at(0);