mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add target: "es2022"
This commit is contained in:
@@ -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,
|
||||
|
||||
+12
-9
@@ -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,
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Vendored
+103
@@ -0,0 +1,103 @@
|
||||
interface Array<T> {
|
||||
/**
|
||||
* 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<T> {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
/// <reference lib="es2021" />
|
||||
/// <reference lib="es2022.array" />
|
||||
/// <reference lib="es2022.string" />
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
/// <reference lib="es2022" />
|
||||
/// <reference lib="dom" />
|
||||
/// <reference lib="webworker.importscripts" />
|
||||
/// <reference lib="scripthost" />
|
||||
/// <reference lib="dom.iterable" />
|
||||
Vendored
+7
@@ -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;
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/// <reference lib="es2021" />
|
||||
/// <reference lib="es2022" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -3509,6 +3509,7 @@ namespace ts.server.protocol {
|
||||
ES2019 = "ES2019",
|
||||
ES2020 = "ES2020",
|
||||
ES2021 = "ES2021",
|
||||
ES2022 = "ES2022",
|
||||
ESNext = "ESNext"
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -3076,6 +3076,7 @@ declare namespace ts {
|
||||
ES2019 = 6,
|
||||
ES2020 = 7,
|
||||
ES2021 = 8,
|
||||
ES2022 = 9,
|
||||
ESNext = 99,
|
||||
JSON = 100,
|
||||
Latest = 99
|
||||
|
||||
@@ -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"]?.(); }
|
||||
}
|
||||
@@ -30,7 +30,7 @@ declare const pli: {
|
||||
|
||||
(streams: ReadonlyArray<R | W | RW>): Promise<void>;
|
||||
>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, --, --))
|
||||
|
||||
@@ -15,7 +15,7 @@ const bar = foo.flatMap(bar => bar as Foo);
|
||||
|
||||
interface Foo extends Array<string> {}
|
||||
>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
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
@@ -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, --, --))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
@@ -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, --, --))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
@@ -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, --, --))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -440,9 +440,9 @@ function fn<T extends {elements: Array<string>} | {elements: Array<number>}>(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<T extends {elements: Array<string>} | {elements: Array<number>}>(par
|
||||
function fn2<T extends Array<string>>(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<T extends Array<string>>(param: T, cb: (element: T[number]) => void
|
||||
function fn3<T extends ReadonlyArray<string>>(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<K extends number>() {
|
||||
|
||||
let x: Array<string>[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<string>[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))
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ declare function f<T>(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))
|
||||
|
||||
|
||||
+2
-2
@@ -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.
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ default: true
|
||||
|
||||
[94m--target, -t[39m
|
||||
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
|
||||
|
||||
[94m--module, -m[39m
|
||||
@@ -77,7 +77,7 @@ one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, n
|
||||
|
||||
[94m--lib[39m
|
||||
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
|
||||
|
||||
[94m--allowJs[39m
|
||||
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ default: true
|
||||
|
||||
[94m--target, -t[39m
|
||||
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
|
||||
|
||||
[94m--module, -m[39m
|
||||
@@ -77,7 +77,7 @@ one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, n
|
||||
|
||||
[94m--lib[39m
|
||||
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
|
||||
|
||||
[94m--allowJs[39m
|
||||
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user