From 5b7da72b0d93bb9d24f757783db61198d92c9e9f Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 10 Oct 2021 13:24:53 +0200 Subject: [PATCH] Add `target: "es2022"` --- src/compiler/commandLineParser.ts | 8 +- src/compiler/types.ts | 21 ++-- src/compiler/utilities.ts | 15 +++ src/compiler/utilitiesPublic.ts | 2 + src/lib/es2022.array.d.ts | 103 +++++++++++++++++ src/lib/es2022.d.ts | 3 + src/lib/es2022.full.d.ts | 5 + src/lib/es2022.string.d.ts | 7 ++ src/lib/esnext.d.ts | 2 +- src/lib/libs.json | 4 + src/server/protocol.ts | 1 + .../unittests/config/commandLineParsing.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 + tests/baselines/reference/api/typescript.d.ts | 1 + .../callChainWithSuper(target=es2022).js | 18 +++ .../reference/callWithSpread4.symbols | 4 +- .../flatArrayNoExcessiveStackDepth.symbols | 2 +- .../importExportInternalComments.symbols | 2 +- .../indexAt(target=es2021).errors.txt | 56 ++++++++++ .../reference/indexAt(target=es2021).js | 30 +++++ .../reference/indexAt(target=es2021).symbols | 36 ++++++ .../reference/indexAt(target=es2021).types | 104 ++++++++++++++++++ .../reference/indexAt(target=es2022).js | 30 +++++ .../reference/indexAt(target=es2022).symbols | 64 +++++++++++ .../reference/indexAt(target=es2022).types | 104 ++++++++++++++++++ .../reference/indexAt(target=esnext).js | 30 +++++ .../reference/indexAt(target=esnext).symbols | 64 +++++++++++ .../reference/indexAt(target=esnext).types | 104 ++++++++++++++++++ .../reference/keyofAndIndexedAccess2.symbols | 12 +- .../noIterationTypeErrorsInCFA.symbols | 2 +- .../taggedTemplatesWithTypeArguments1.symbols | 2 +- ...does-not-add-color-when-NO_COLOR-is-set.js | 4 +- ...-when-host-can't-provide-terminal-width.js | 4 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 4 +- .../typeGuardConstructorNarrowAny.symbols | 4 +- ...typeGuardConstructorPrimitiveTypes.symbols | 8 +- tests/cases/compiler/indexAt.ts | 15 +++ 37 files changed, 842 insertions(+), 37 deletions(-) create mode 100644 src/lib/es2022.array.d.ts create mode 100644 src/lib/es2022.d.ts create mode 100644 src/lib/es2022.full.d.ts create mode 100644 src/lib/es2022.string.d.ts create mode 100644 tests/baselines/reference/callChainWithSuper(target=es2022).js create mode 100644 tests/baselines/reference/indexAt(target=es2021).errors.txt create mode 100644 tests/baselines/reference/indexAt(target=es2021).js create mode 100644 tests/baselines/reference/indexAt(target=es2021).symbols create mode 100644 tests/baselines/reference/indexAt(target=es2021).types create mode 100644 tests/baselines/reference/indexAt(target=es2022).js create mode 100644 tests/baselines/reference/indexAt(target=es2022).symbols create mode 100644 tests/baselines/reference/indexAt(target=es2022).types create mode 100644 tests/baselines/reference/indexAt(target=esnext).js create mode 100644 tests/baselines/reference/indexAt(target=esnext).symbols create mode 100644 tests/baselines/reference/indexAt(target=esnext).types create mode 100644 tests/cases/compiler/indexAt.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 676b995d8c9..7c9f02f58fe 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,14 @@ 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.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"] ]; @@ -308,6 +311,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 beff69baaa1..ddce41f66d7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6254,6 +6254,7 @@ namespace ts { ES2019 = 6, ES2020 = 7, ES2021 = 8, + ES2022 = 9, ESNext = 99, JSON = 100, Latest = ESNext, @@ -6699,15 +6700,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. @@ -6736,6 +6738,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 4b225a0ad0e..af417e85427 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -627,6 +627,21 @@ namespace ts { PromiseConstructor: ["any"], String: ["replaceAll"] }, + 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"], + }, esnext: { NumberFormat: ["formatToParts"] } diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index d638ec32a82..8f834e5e459 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 00000000000..7be111c7f06 --- /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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} diff --git a/src/lib/es2022.d.ts b/src/lib/es2022.d.ts new file mode 100644 index 00000000000..cb772d56bc2 --- /dev/null +++ b/src/lib/es2022.d.ts @@ -0,0 +1,3 @@ +/// +/// +/// diff --git a/src/lib/es2022.full.d.ts b/src/lib/es2022.full.d.ts new file mode 100644 index 00000000000..f7a8fdc84c1 --- /dev/null +++ b/src/lib/es2022.full.d.ts @@ -0,0 +1,5 @@ +/// +/// +/// +/// +/// diff --git a/src/lib/es2022.string.d.ts b/src/lib/es2022.string.d.ts new file mode 100644 index 00000000000..13b62eae3f8 --- /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; +} diff --git a/src/lib/esnext.d.ts b/src/lib/esnext.d.ts index 4a3ac819c19..6735ced8f73 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 4131d45171b..c40a26909af 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,8 @@ "es2021.promise", "es2021.weakref", "es2021.intl", + "es2022.array", + "es2022.string", "esnext.intl", // Default libraries "es5.full", @@ -62,6 +65,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 67d6fda2a3b..d52148154a0 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 500f249288d..abf3b7cf857 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 349e025e58e..40154b55280 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3076,6 +3076,7 @@ declare namespace ts { ES2019 = 6, ES2020 = 7, ES2021 = 8, + ES2022 = 9, ESNext = 99, JSON = 100, Latest = 99 @@ -9656,6 +9657,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 2a2c398553c..af7b6edbbd3 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3076,6 +3076,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 00000000000..30e1ad3886d --- /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 dbb75765828..428f41b17c3 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/flatArrayNoExcessiveStackDepth.symbols b/tests/baselines/reference/flatArrayNoExcessiveStackDepth.symbols index 4b27f6006cb..bbd3083d04c 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 87eeb2d31e9..e4c5f85d9bd 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 00000000000..9307c2f7d56 --- /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 00000000000..01ffbff4919 --- /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 00000000000..383f372fadd --- /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 00000000000..8229bcacb93 --- /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 00000000000..01ffbff4919 --- /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 00000000000..09b7425331f --- /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 00000000000..36fbb503e42 --- /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 00000000000..01ffbff4919 --- /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 00000000000..09b7425331f --- /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 00000000000..36fbb503e42 --- /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/keyofAndIndexedAccess2.symbols b/tests/baselines/reference/keyofAndIndexedAccess2.symbols index 1c3758c137d..a17aafe571a 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 3498f52d456..60040c3ed17 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/taggedTemplatesWithTypeArguments1.symbols b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols index 4cd6dce23e3..f37166423f1 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 100d910dfba..f52c4c9add7 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.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 3b4922b2fe6..51d8ffdd895 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.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 3b4922b2fe6..51d8ffdd895 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.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 acbc179aa27..980e68c3f1c 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 1bcc2f586eb..7258c198d18 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/cases/compiler/indexAt.ts b/tests/cases/compiler/indexAt.ts new file mode 100644 index 00000000000..d41117903a5 --- /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);