From e67d6e5f6062d72b830893e9988840779cb7fa8c Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Wed, 27 Oct 2021 00:54:54 +0200 Subject: [PATCH] optional parameter --- src/lib/es2022.array.d.ts | 26 ++-- src/lib/es2022.string.d.ts | 2 +- .../indexAt(target=es2021).errors.txt | 55 ++++++- .../reference/indexAt(target=es2021).js | 27 ++++ .../reference/indexAt(target=es2021).symbols | 35 +++++ .../reference/indexAt(target=es2021).types | 90 +++++++++++ .../reference/indexAt(target=es2022).js | 27 ++++ .../reference/indexAt(target=es2022).symbols | 63 ++++++++ .../reference/indexAt(target=es2022).types | 142 ++++++++++++++---- .../reference/indexAt(target=esnext).js | 27 ++++ .../reference/indexAt(target=esnext).symbols | 63 ++++++++ .../reference/indexAt(target=esnext).types | 142 ++++++++++++++---- tests/cases/compiler/indexAt.ts | 14 ++ 13 files changed, 646 insertions(+), 67 deletions(-) diff --git a/src/lib/es2022.array.d.ts b/src/lib/es2022.array.d.ts index e0e0d2c81dfcf..7f97dd66dab6a 100644 --- a/src/lib/es2022.array.d.ts +++ b/src/lib/es2022.array.d.ts @@ -3,7 +3,7 @@ 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; + at(index?: number): T; } interface ReadonlyArray { @@ -11,7 +11,7 @@ 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; + at(index?: number): T; } interface Int8Array { @@ -19,7 +19,7 @@ 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; + at(index?: number): number; } interface Uint8Array { @@ -27,7 +27,7 @@ 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; + at(index?: number): number; } interface Uint8ClampedArray { @@ -35,7 +35,7 @@ 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; + at(index?: number): number; } interface Int16Array { @@ -43,7 +43,7 @@ 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; + at(index?: number): number; } interface Uint16Array { @@ -51,7 +51,7 @@ 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; + at(index?: number): number; } interface Int32Array { @@ -59,7 +59,7 @@ 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; + at(index?: number): number; } interface Uint32Array { @@ -67,7 +67,7 @@ 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; + at(index?: number): number; } interface Float32Array { @@ -75,7 +75,7 @@ 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; + at(index?: number): number; } interface Float64Array { @@ -83,7 +83,7 @@ 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; + at(index?: number): number; } interface BigInt64Array { @@ -91,7 +91,7 @@ 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; + at(index?: number): number; } interface BigUint64Array { @@ -99,5 +99,5 @@ 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; + at(index?: number): number; } diff --git a/src/lib/es2022.string.d.ts b/src/lib/es2022.string.d.ts index cbb19f85268f3..6b94984ad287f 100644 --- a/src/lib/es2022.string.d.ts +++ b/src/lib/es2022.string.d.ts @@ -3,5 +3,5 @@ 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; + at(index?: number): string; } diff --git a/tests/baselines/reference/indexAt(target=es2021).errors.txt b/tests/baselines/reference/indexAt(target=es2021).errors.txt index 9307c2f7d5623..5a1240199523c 100644 --- a/tests/baselines/reference/indexAt(target=es2021).errors.txt +++ b/tests/baselines/reference/indexAt(target=es2021).errors.txt @@ -11,9 +11,22 @@ tests/cases/compiler/indexAt.ts(10,20): error TS2550: Property 'at' does not exi 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(15,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(16,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(17,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(18,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(19,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(20,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(21,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(22,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(23,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(24,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(25,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(26,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(27,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) ==== +==== tests/cases/compiler/indexAt.ts (26 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. @@ -53,4 +66,44 @@ tests/cases/compiler/indexAt.ts(13,22): error TS2550: Property 'at' does not exi 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].at(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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(); + ~~ +!!! 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 index 01ffbff491904..06cd5259a4b56 100644 --- a/tests/baselines/reference/indexAt(target=es2021).js +++ b/tests/baselines/reference/indexAt(target=es2021).js @@ -12,6 +12,20 @@ new Float32Array().at(0); new Float64Array().at(0); new BigInt64Array().at(0); new BigUint64Array().at(0); + +[0].at(); +"foo".at(); +new Int8Array().at(); +new Uint8Array().at(); +new Uint8ClampedArray().at(); +new Int16Array().at(); +new Uint16Array().at(); +new Int32Array().at(); +new Uint32Array().at(); +new Float32Array().at(); +new Float64Array().at(); +new BigInt64Array().at(); +new BigUint64Array().at(); //// [indexAt.js] @@ -28,3 +42,16 @@ new Float32Array().at(0); new Float64Array().at(0); new BigInt64Array().at(0); new BigUint64Array().at(0); +[0].at(); +"foo".at(); +new Int8Array().at(); +new Uint8Array().at(); +new Uint8ClampedArray().at(); +new Int16Array().at(); +new Uint16Array().at(); +new Int32Array().at(); +new Uint32Array().at(); +new Float32Array().at(); +new Float64Array().at(); +new BigInt64Array().at(); +new BigUint64Array().at(); diff --git a/tests/baselines/reference/indexAt(target=es2021).symbols b/tests/baselines/reference/indexAt(target=es2021).symbols index 383f372fadd3e..7e11613285f0e 100644 --- a/tests/baselines/reference/indexAt(target=es2021).symbols +++ b/tests/baselines/reference/indexAt(target=es2021).symbols @@ -34,3 +34,38 @@ new BigInt64Array().at(0); new BigUint64Array().at(0); >BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +[0].at(); +"foo".at(); +new Int8Array().at(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +new BigUint64Array().at(); +>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 index 8229bcacb9328..34283de8c65ca 100644 --- a/tests/baselines/reference/indexAt(target=es2021).types +++ b/tests/baselines/reference/indexAt(target=es2021).types @@ -102,3 +102,93 @@ new BigUint64Array().at(0); >at : any >0 : 0 +[0].at(); +>[0].at() : any +>[0].at : any +>[0] : number[] +>0 : 0 +>at : any + +"foo".at(); +>"foo".at() : any +>"foo".at : any +>"foo" : "foo" +>at : any + +new Int8Array().at(); +>new Int8Array().at() : any +>new Int8Array().at : any +>new Int8Array() : Int8Array +>Int8Array : Int8ArrayConstructor +>at : any + +new Uint8Array().at(); +>new Uint8Array().at() : any +>new Uint8Array().at : any +>new Uint8Array() : Uint8Array +>Uint8Array : Uint8ArrayConstructor +>at : any + +new Uint8ClampedArray().at(); +>new Uint8ClampedArray().at() : any +>new Uint8ClampedArray().at : any +>new Uint8ClampedArray() : Uint8ClampedArray +>Uint8ClampedArray : Uint8ClampedArrayConstructor +>at : any + +new Int16Array().at(); +>new Int16Array().at() : any +>new Int16Array().at : any +>new Int16Array() : Int16Array +>Int16Array : Int16ArrayConstructor +>at : any + +new Uint16Array().at(); +>new Uint16Array().at() : any +>new Uint16Array().at : any +>new Uint16Array() : Uint16Array +>Uint16Array : Uint16ArrayConstructor +>at : any + +new Int32Array().at(); +>new Int32Array().at() : any +>new Int32Array().at : any +>new Int32Array() : Int32Array +>Int32Array : Int32ArrayConstructor +>at : any + +new Uint32Array().at(); +>new Uint32Array().at() : any +>new Uint32Array().at : any +>new Uint32Array() : Uint32Array +>Uint32Array : Uint32ArrayConstructor +>at : any + +new Float32Array().at(); +>new Float32Array().at() : any +>new Float32Array().at : any +>new Float32Array() : Float32Array +>Float32Array : Float32ArrayConstructor +>at : any + +new Float64Array().at(); +>new Float64Array().at() : any +>new Float64Array().at : any +>new Float64Array() : Float64Array +>Float64Array : Float64ArrayConstructor +>at : any + +new BigInt64Array().at(); +>new BigInt64Array().at() : any +>new BigInt64Array().at : any +>new BigInt64Array() : BigInt64Array +>BigInt64Array : BigInt64ArrayConstructor +>at : any + +new BigUint64Array().at(); +>new BigUint64Array().at() : any +>new BigUint64Array().at : any +>new BigUint64Array() : BigUint64Array +>BigUint64Array : BigUint64ArrayConstructor +>at : any + diff --git a/tests/baselines/reference/indexAt(target=es2022).js b/tests/baselines/reference/indexAt(target=es2022).js index 01ffbff491904..06cd5259a4b56 100644 --- a/tests/baselines/reference/indexAt(target=es2022).js +++ b/tests/baselines/reference/indexAt(target=es2022).js @@ -12,6 +12,20 @@ new Float32Array().at(0); new Float64Array().at(0); new BigInt64Array().at(0); new BigUint64Array().at(0); + +[0].at(); +"foo".at(); +new Int8Array().at(); +new Uint8Array().at(); +new Uint8ClampedArray().at(); +new Int16Array().at(); +new Uint16Array().at(); +new Int32Array().at(); +new Uint32Array().at(); +new Float32Array().at(); +new Float64Array().at(); +new BigInt64Array().at(); +new BigUint64Array().at(); //// [indexAt.js] @@ -28,3 +42,16 @@ new Float32Array().at(0); new Float64Array().at(0); new BigInt64Array().at(0); new BigUint64Array().at(0); +[0].at(); +"foo".at(); +new Int8Array().at(); +new Uint8Array().at(); +new Uint8ClampedArray().at(); +new Int16Array().at(); +new Uint16Array().at(); +new Int32Array().at(); +new Uint32Array().at(); +new Float32Array().at(); +new Float64Array().at(); +new BigInt64Array().at(); +new BigUint64Array().at(); diff --git a/tests/baselines/reference/indexAt(target=es2022).symbols b/tests/baselines/reference/indexAt(target=es2022).symbols index 09b7425331f42..cbf259fb6e01f 100644 --- a/tests/baselines/reference/indexAt(target=es2022).symbols +++ b/tests/baselines/reference/indexAt(target=es2022).symbols @@ -62,3 +62,66 @@ new BigUint64Array().at(0); >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].at(); +>[0].at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +"foo".at(); +>"foo".at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) +>at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) + +new Int8Array().at(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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 index 36fbb503e4258..62dc9624a243a 100644 --- a/tests/baselines/reference/indexAt(target=es2022).types +++ b/tests/baselines/reference/indexAt(target=es2022).types @@ -1,104 +1,194 @@ === tests/cases/compiler/indexAt.ts === [0].at(0); >[0].at(0) : number ->[0].at : (index: number) => number +>[0].at : (index?: number) => number >[0] : number[] >0 : 0 ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 "foo".at(0); >"foo".at(0) : string ->"foo".at : (index: number) => string +>"foo".at : (index?: number) => string >"foo" : "foo" ->at : (index: number) => string +>at : (index?: number) => string >0 : 0 new Int8Array().at(0); >new Int8Array().at(0) : number ->new Int8Array().at : (index: number) => number +>new Int8Array().at : (index?: number) => number >new Int8Array() : Int8Array >Int8Array : Int8ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint8Array().at(0); >new Uint8Array().at(0) : number ->new Uint8Array().at : (index: number) => number +>new Uint8Array().at : (index?: number) => number >new Uint8Array() : Uint8Array >Uint8Array : Uint8ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint8ClampedArray().at(0); >new Uint8ClampedArray().at(0) : number ->new Uint8ClampedArray().at : (index: number) => number +>new Uint8ClampedArray().at : (index?: number) => number >new Uint8ClampedArray() : Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Int16Array().at(0); >new Int16Array().at(0) : number ->new Int16Array().at : (index: number) => number +>new Int16Array().at : (index?: number) => number >new Int16Array() : Int16Array >Int16Array : Int16ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint16Array().at(0); >new Uint16Array().at(0) : number ->new Uint16Array().at : (index: number) => number +>new Uint16Array().at : (index?: number) => number >new Uint16Array() : Uint16Array >Uint16Array : Uint16ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Int32Array().at(0); >new Int32Array().at(0) : number ->new Int32Array().at : (index: number) => number +>new Int32Array().at : (index?: number) => number >new Int32Array() : Int32Array >Int32Array : Int32ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint32Array().at(0); >new Uint32Array().at(0) : number ->new Uint32Array().at : (index: number) => number +>new Uint32Array().at : (index?: number) => number >new Uint32Array() : Uint32Array >Uint32Array : Uint32ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Float32Array().at(0); >new Float32Array().at(0) : number ->new Float32Array().at : (index: number) => number +>new Float32Array().at : (index?: number) => number >new Float32Array() : Float32Array >Float32Array : Float32ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Float64Array().at(0); >new Float64Array().at(0) : number ->new Float64Array().at : (index: number) => number +>new Float64Array().at : (index?: number) => number >new Float64Array() : Float64Array >Float64Array : Float64ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new BigInt64Array().at(0); >new BigInt64Array().at(0) : number ->new BigInt64Array().at : (index: number) => number +>new BigInt64Array().at : (index?: number) => number >new BigInt64Array() : BigInt64Array >BigInt64Array : BigInt64ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new BigUint64Array().at(0); >new BigUint64Array().at(0) : number ->new BigUint64Array().at : (index: number) => number +>new BigUint64Array().at : (index?: number) => number >new BigUint64Array() : BigUint64Array >BigUint64Array : BigUint64ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 +[0].at(); +>[0].at() : number +>[0].at : (index?: number) => number +>[0] : number[] +>0 : 0 +>at : (index?: number) => number + +"foo".at(); +>"foo".at() : string +>"foo".at : (index?: number) => string +>"foo" : "foo" +>at : (index?: number) => string + +new Int8Array().at(); +>new Int8Array().at() : number +>new Int8Array().at : (index?: number) => number +>new Int8Array() : Int8Array +>Int8Array : Int8ArrayConstructor +>at : (index?: number) => number + +new Uint8Array().at(); +>new Uint8Array().at() : number +>new Uint8Array().at : (index?: number) => number +>new Uint8Array() : Uint8Array +>Uint8Array : Uint8ArrayConstructor +>at : (index?: number) => number + +new Uint8ClampedArray().at(); +>new Uint8ClampedArray().at() : number +>new Uint8ClampedArray().at : (index?: number) => number +>new Uint8ClampedArray() : Uint8ClampedArray +>Uint8ClampedArray : Uint8ClampedArrayConstructor +>at : (index?: number) => number + +new Int16Array().at(); +>new Int16Array().at() : number +>new Int16Array().at : (index?: number) => number +>new Int16Array() : Int16Array +>Int16Array : Int16ArrayConstructor +>at : (index?: number) => number + +new Uint16Array().at(); +>new Uint16Array().at() : number +>new Uint16Array().at : (index?: number) => number +>new Uint16Array() : Uint16Array +>Uint16Array : Uint16ArrayConstructor +>at : (index?: number) => number + +new Int32Array().at(); +>new Int32Array().at() : number +>new Int32Array().at : (index?: number) => number +>new Int32Array() : Int32Array +>Int32Array : Int32ArrayConstructor +>at : (index?: number) => number + +new Uint32Array().at(); +>new Uint32Array().at() : number +>new Uint32Array().at : (index?: number) => number +>new Uint32Array() : Uint32Array +>Uint32Array : Uint32ArrayConstructor +>at : (index?: number) => number + +new Float32Array().at(); +>new Float32Array().at() : number +>new Float32Array().at : (index?: number) => number +>new Float32Array() : Float32Array +>Float32Array : Float32ArrayConstructor +>at : (index?: number) => number + +new Float64Array().at(); +>new Float64Array().at() : number +>new Float64Array().at : (index?: number) => number +>new Float64Array() : Float64Array +>Float64Array : Float64ArrayConstructor +>at : (index?: number) => number + +new BigInt64Array().at(); +>new BigInt64Array().at() : number +>new BigInt64Array().at : (index?: number) => number +>new BigInt64Array() : BigInt64Array +>BigInt64Array : BigInt64ArrayConstructor +>at : (index?: number) => number + +new BigUint64Array().at(); +>new BigUint64Array().at() : number +>new BigUint64Array().at : (index?: number) => number +>new BigUint64Array() : BigUint64Array +>BigUint64Array : BigUint64ArrayConstructor +>at : (index?: number) => number + diff --git a/tests/baselines/reference/indexAt(target=esnext).js b/tests/baselines/reference/indexAt(target=esnext).js index 01ffbff491904..06cd5259a4b56 100644 --- a/tests/baselines/reference/indexAt(target=esnext).js +++ b/tests/baselines/reference/indexAt(target=esnext).js @@ -12,6 +12,20 @@ new Float32Array().at(0); new Float64Array().at(0); new BigInt64Array().at(0); new BigUint64Array().at(0); + +[0].at(); +"foo".at(); +new Int8Array().at(); +new Uint8Array().at(); +new Uint8ClampedArray().at(); +new Int16Array().at(); +new Uint16Array().at(); +new Int32Array().at(); +new Uint32Array().at(); +new Float32Array().at(); +new Float64Array().at(); +new BigInt64Array().at(); +new BigUint64Array().at(); //// [indexAt.js] @@ -28,3 +42,16 @@ new Float32Array().at(0); new Float64Array().at(0); new BigInt64Array().at(0); new BigUint64Array().at(0); +[0].at(); +"foo".at(); +new Int8Array().at(); +new Uint8Array().at(); +new Uint8ClampedArray().at(); +new Int16Array().at(); +new Uint16Array().at(); +new Int32Array().at(); +new Uint32Array().at(); +new Float32Array().at(); +new Float64Array().at(); +new BigInt64Array().at(); +new BigUint64Array().at(); diff --git a/tests/baselines/reference/indexAt(target=esnext).symbols b/tests/baselines/reference/indexAt(target=esnext).symbols index 09b7425331f42..cbf259fb6e01f 100644 --- a/tests/baselines/reference/indexAt(target=esnext).symbols +++ b/tests/baselines/reference/indexAt(target=esnext).symbols @@ -62,3 +62,66 @@ new BigUint64Array().at(0); >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].at(); +>[0].at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) +>at : Symbol(Array.at, Decl(lib.es2022.array.d.ts, --, --)) + +"foo".at(); +>"foo".at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) +>at : Symbol(String.at, Decl(lib.es2022.string.d.ts, --, --)) + +new Int8Array().at(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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(); +>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 index 36fbb503e4258..62dc9624a243a 100644 --- a/tests/baselines/reference/indexAt(target=esnext).types +++ b/tests/baselines/reference/indexAt(target=esnext).types @@ -1,104 +1,194 @@ === tests/cases/compiler/indexAt.ts === [0].at(0); >[0].at(0) : number ->[0].at : (index: number) => number +>[0].at : (index?: number) => number >[0] : number[] >0 : 0 ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 "foo".at(0); >"foo".at(0) : string ->"foo".at : (index: number) => string +>"foo".at : (index?: number) => string >"foo" : "foo" ->at : (index: number) => string +>at : (index?: number) => string >0 : 0 new Int8Array().at(0); >new Int8Array().at(0) : number ->new Int8Array().at : (index: number) => number +>new Int8Array().at : (index?: number) => number >new Int8Array() : Int8Array >Int8Array : Int8ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint8Array().at(0); >new Uint8Array().at(0) : number ->new Uint8Array().at : (index: number) => number +>new Uint8Array().at : (index?: number) => number >new Uint8Array() : Uint8Array >Uint8Array : Uint8ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint8ClampedArray().at(0); >new Uint8ClampedArray().at(0) : number ->new Uint8ClampedArray().at : (index: number) => number +>new Uint8ClampedArray().at : (index?: number) => number >new Uint8ClampedArray() : Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Int16Array().at(0); >new Int16Array().at(0) : number ->new Int16Array().at : (index: number) => number +>new Int16Array().at : (index?: number) => number >new Int16Array() : Int16Array >Int16Array : Int16ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint16Array().at(0); >new Uint16Array().at(0) : number ->new Uint16Array().at : (index: number) => number +>new Uint16Array().at : (index?: number) => number >new Uint16Array() : Uint16Array >Uint16Array : Uint16ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Int32Array().at(0); >new Int32Array().at(0) : number ->new Int32Array().at : (index: number) => number +>new Int32Array().at : (index?: number) => number >new Int32Array() : Int32Array >Int32Array : Int32ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Uint32Array().at(0); >new Uint32Array().at(0) : number ->new Uint32Array().at : (index: number) => number +>new Uint32Array().at : (index?: number) => number >new Uint32Array() : Uint32Array >Uint32Array : Uint32ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Float32Array().at(0); >new Float32Array().at(0) : number ->new Float32Array().at : (index: number) => number +>new Float32Array().at : (index?: number) => number >new Float32Array() : Float32Array >Float32Array : Float32ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new Float64Array().at(0); >new Float64Array().at(0) : number ->new Float64Array().at : (index: number) => number +>new Float64Array().at : (index?: number) => number >new Float64Array() : Float64Array >Float64Array : Float64ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new BigInt64Array().at(0); >new BigInt64Array().at(0) : number ->new BigInt64Array().at : (index: number) => number +>new BigInt64Array().at : (index?: number) => number >new BigInt64Array() : BigInt64Array >BigInt64Array : BigInt64ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 new BigUint64Array().at(0); >new BigUint64Array().at(0) : number ->new BigUint64Array().at : (index: number) => number +>new BigUint64Array().at : (index?: number) => number >new BigUint64Array() : BigUint64Array >BigUint64Array : BigUint64ArrayConstructor ->at : (index: number) => number +>at : (index?: number) => number >0 : 0 +[0].at(); +>[0].at() : number +>[0].at : (index?: number) => number +>[0] : number[] +>0 : 0 +>at : (index?: number) => number + +"foo".at(); +>"foo".at() : string +>"foo".at : (index?: number) => string +>"foo" : "foo" +>at : (index?: number) => string + +new Int8Array().at(); +>new Int8Array().at() : number +>new Int8Array().at : (index?: number) => number +>new Int8Array() : Int8Array +>Int8Array : Int8ArrayConstructor +>at : (index?: number) => number + +new Uint8Array().at(); +>new Uint8Array().at() : number +>new Uint8Array().at : (index?: number) => number +>new Uint8Array() : Uint8Array +>Uint8Array : Uint8ArrayConstructor +>at : (index?: number) => number + +new Uint8ClampedArray().at(); +>new Uint8ClampedArray().at() : number +>new Uint8ClampedArray().at : (index?: number) => number +>new Uint8ClampedArray() : Uint8ClampedArray +>Uint8ClampedArray : Uint8ClampedArrayConstructor +>at : (index?: number) => number + +new Int16Array().at(); +>new Int16Array().at() : number +>new Int16Array().at : (index?: number) => number +>new Int16Array() : Int16Array +>Int16Array : Int16ArrayConstructor +>at : (index?: number) => number + +new Uint16Array().at(); +>new Uint16Array().at() : number +>new Uint16Array().at : (index?: number) => number +>new Uint16Array() : Uint16Array +>Uint16Array : Uint16ArrayConstructor +>at : (index?: number) => number + +new Int32Array().at(); +>new Int32Array().at() : number +>new Int32Array().at : (index?: number) => number +>new Int32Array() : Int32Array +>Int32Array : Int32ArrayConstructor +>at : (index?: number) => number + +new Uint32Array().at(); +>new Uint32Array().at() : number +>new Uint32Array().at : (index?: number) => number +>new Uint32Array() : Uint32Array +>Uint32Array : Uint32ArrayConstructor +>at : (index?: number) => number + +new Float32Array().at(); +>new Float32Array().at() : number +>new Float32Array().at : (index?: number) => number +>new Float32Array() : Float32Array +>Float32Array : Float32ArrayConstructor +>at : (index?: number) => number + +new Float64Array().at(); +>new Float64Array().at() : number +>new Float64Array().at : (index?: number) => number +>new Float64Array() : Float64Array +>Float64Array : Float64ArrayConstructor +>at : (index?: number) => number + +new BigInt64Array().at(); +>new BigInt64Array().at() : number +>new BigInt64Array().at : (index?: number) => number +>new BigInt64Array() : BigInt64Array +>BigInt64Array : BigInt64ArrayConstructor +>at : (index?: number) => number + +new BigUint64Array().at(); +>new BigUint64Array().at() : number +>new BigUint64Array().at : (index?: number) => number +>new BigUint64Array() : BigUint64Array +>BigUint64Array : BigUint64ArrayConstructor +>at : (index?: number) => number + diff --git a/tests/cases/compiler/indexAt.ts b/tests/cases/compiler/indexAt.ts index d41117903a5b1..244bcad07a366 100644 --- a/tests/cases/compiler/indexAt.ts +++ b/tests/cases/compiler/indexAt.ts @@ -13,3 +13,17 @@ new Float32Array().at(0); new Float64Array().at(0); new BigInt64Array().at(0); new BigUint64Array().at(0); + +[0].at(); +"foo".at(); +new Int8Array().at(); +new Uint8Array().at(); +new Uint8ClampedArray().at(); +new Int16Array().at(); +new Uint16Array().at(); +new Int32Array().at(); +new Uint32Array().at(); +new Float32Array().at(); +new Float64Array().at(); +new BigInt64Array().at(); +new BigUint64Array().at();