Add 2023 array methods to target features (#52242)

This commit is contained in:
Oliver Radini
2023-01-25 10:31:53 -08:00
committed by GitHub
parent be488fa075
commit a311e25305
9 changed files with 1210 additions and 1 deletions
+14
View File
@@ -1279,6 +1279,20 @@ export function getScriptTargetFeatures(): ScriptTargetFeatures {
BigUint64Array: ["at"],
ObjectConstructor: ["hasOwn"],
Error: ["cause"]
},
es2023: {
Array: ["findLastIndex", "findLast"],
Int8Array: ["findLastIndex", "findLast"],
Uint8Array: ["findLastIndex", "findLast"],
Uint8ClampedArray: ["findLastIndex", "findLast"],
Int16Array: ["findLastIndex", "findLast"],
Uint16Array: ["findLastIndex", "findLast"],
Int32Array: ["findLastIndex", "findLast"],
Uint32Array: ["findLastIndex", "findLast"],
Float32Array: ["findLastIndex", "findLast"],
Float64Array: ["findLastIndex", "findLast"],
BigInt64Array: ["findLastIndex", "findLast"],
BigUint64Array: ["findLastIndex", "findLast"],
}
};
}
@@ -0,0 +1,109 @@
tests/cases/compiler/findLast.ts(1,44): error TS2550: Property 'findLast' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(2,51): error TS2550: Property 'findLast' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(3,17): error TS2550: Property 'findLast' does not exist on type 'Int8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(4,18): error TS2550: Property 'findLast' does not exist on type 'Uint8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(5,25): error TS2550: Property 'findLast' does not exist on type 'Uint8ClampedArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(6,18): error TS2550: Property 'findLast' does not exist on type 'Int16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(7,19): error TS2550: Property 'findLast' does not exist on type 'Uint16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(8,18): error TS2550: Property 'findLast' does not exist on type 'Int32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(9,19): error TS2550: Property 'findLast' does not exist on type 'Uint32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(10,20): error TS2550: Property 'findLast' does not exist on type 'Float32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(11,20): error TS2550: Property 'findLast' does not exist on type 'Float64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(12,21): error TS2550: Property 'findLast' does not exist on type 'BigInt64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(13,22): error TS2550: Property 'findLast' does not exist on type 'BigUint64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(15,33): error TS2550: Property 'findLastIndex' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(16,40): error TS2550: Property 'findLastIndex' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(17,17): error TS2550: Property 'findLastIndex' does not exist on type 'Int8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(18,18): error TS2550: Property 'findLastIndex' does not exist on type 'Uint8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(19,25): error TS2550: Property 'findLastIndex' does not exist on type 'Uint8ClampedArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(20,18): error TS2550: Property 'findLastIndex' does not exist on type 'Int16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(21,19): error TS2550: Property 'findLastIndex' does not exist on type 'Uint16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(22,18): error TS2550: Property 'findLastIndex' does not exist on type 'Int32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(23,19): error TS2550: Property 'findLastIndex' does not exist on type 'Uint32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(24,20): error TS2550: Property 'findLastIndex' does not exist on type 'Float32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(25,20): error TS2550: Property 'findLastIndex' does not exist on type 'Float64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(26,21): error TS2550: Property 'findLastIndex' does not exist on type 'BigInt64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
tests/cases/compiler/findLast.ts(27,22): error TS2550: Property 'findLastIndex' does not exist on type 'BigUint64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
==== tests/cases/compiler/findLast.ts (26 errors) ====
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
const itemString: string | undefined = ["string"].findLast((item) => item === "string");
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Int8Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Int8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint8Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Uint8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint8ClampedArray().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Uint8ClampedArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Int16Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Int16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint16Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Uint16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Int32Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Int32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint32Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Uint32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Float32Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Float32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Float64Array().findLast((item) => item === 0);
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'Float64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new BigInt64Array().findLast((item) => item === BigInt(0));
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'BigInt64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new BigUint64Array().findLast((item) => item === BigInt(0));
~~~~~~~~
!!! error TS2550: Property 'findLast' does not exist on type 'BigUint64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
const indexNumber: number = [0].findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
const indexString: number = ["string"].findLastIndex((item) => item === "string");
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Int8Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Int8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint8Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Uint8Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint8ClampedArray().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Uint8ClampedArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Int16Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Int16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint16Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Uint16Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Int32Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Int32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Uint32Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Uint32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Float32Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Float32Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new Float64Array().findLastIndex((item) => item === 0);
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'Float64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'BigInt64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
~~~~~~~~~~~~~
!!! error TS2550: Property 'findLastIndex' does not exist on type 'BigUint64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
@@ -0,0 +1,57 @@
//// [findLast.ts]
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
const itemString: string | undefined = ["string"].findLast((item) => item === "string");
new Int8Array().findLast((item) => item === 0);
new Uint8Array().findLast((item) => item === 0);
new Uint8ClampedArray().findLast((item) => item === 0);
new Int16Array().findLast((item) => item === 0);
new Uint16Array().findLast((item) => item === 0);
new Int32Array().findLast((item) => item === 0);
new Uint32Array().findLast((item) => item === 0);
new Float32Array().findLast((item) => item === 0);
new Float64Array().findLast((item) => item === 0);
new BigInt64Array().findLast((item) => item === BigInt(0));
new BigUint64Array().findLast((item) => item === BigInt(0));
const indexNumber: number = [0].findLastIndex((item) => item === 0);
const indexString: number = ["string"].findLastIndex((item) => item === "string");
new Int8Array().findLastIndex((item) => item === 0);
new Uint8Array().findLastIndex((item) => item === 0);
new Uint8ClampedArray().findLastIndex((item) => item === 0);
new Int16Array().findLastIndex((item) => item === 0);
new Uint16Array().findLastIndex((item) => item === 0);
new Int32Array().findLastIndex((item) => item === 0);
new Uint32Array().findLastIndex((item) => item === 0);
new Float32Array().findLastIndex((item) => item === 0);
new Float64Array().findLastIndex((item) => item === 0);
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
//// [findLast.js]
const itemNumber = [0].findLast((item) => item === 0);
const itemString = ["string"].findLast((item) => item === "string");
new Int8Array().findLast((item) => item === 0);
new Uint8Array().findLast((item) => item === 0);
new Uint8ClampedArray().findLast((item) => item === 0);
new Int16Array().findLast((item) => item === 0);
new Uint16Array().findLast((item) => item === 0);
new Int32Array().findLast((item) => item === 0);
new Uint32Array().findLast((item) => item === 0);
new Float32Array().findLast((item) => item === 0);
new Float64Array().findLast((item) => item === 0);
new BigInt64Array().findLast((item) => item === BigInt(0));
new BigUint64Array().findLast((item) => item === BigInt(0));
const indexNumber = [0].findLastIndex((item) => item === 0);
const indexString = ["string"].findLastIndex((item) => item === "string");
new Int8Array().findLastIndex((item) => item === 0);
new Uint8Array().findLastIndex((item) => item === 0);
new Uint8ClampedArray().findLastIndex((item) => item === 0);
new Int16Array().findLastIndex((item) => item === 0);
new Uint16Array().findLastIndex((item) => item === 0);
new Int32Array().findLastIndex((item) => item === 0);
new Uint32Array().findLastIndex((item) => item === 0);
new Float32Array().findLastIndex((item) => item === 0);
new Float64Array().findLastIndex((item) => item === 0);
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
@@ -0,0 +1,135 @@
=== tests/cases/compiler/findLast.ts ===
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
>itemNumber : Symbol(itemNumber, Decl(findLast.ts, 0, 5))
>item : Symbol(item, Decl(findLast.ts, 0, 53))
>item : Symbol(item, Decl(findLast.ts, 0, 53))
const itemString: string | undefined = ["string"].findLast((item) => item === "string");
>itemString : Symbol(itemString, Decl(findLast.ts, 1, 5))
>item : Symbol(item, Decl(findLast.ts, 1, 60))
>item : Symbol(item, Decl(findLast.ts, 1, 60))
new Int8Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 2, 26))
>item : Symbol(item, Decl(findLast.ts, 2, 26))
new Uint8Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 3, 27))
>item : Symbol(item, Decl(findLast.ts, 3, 27))
new Uint8ClampedArray().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 4, 34))
>item : Symbol(item, Decl(findLast.ts, 4, 34))
new Int16Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 5, 27))
>item : Symbol(item, Decl(findLast.ts, 5, 27))
new Uint16Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 6, 28))
>item : Symbol(item, Decl(findLast.ts, 6, 28))
new Int32Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 7, 27))
>item : Symbol(item, Decl(findLast.ts, 7, 27))
new Uint32Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 8, 28))
>item : Symbol(item, Decl(findLast.ts, 8, 28))
new Float32Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 9, 29))
>item : Symbol(item, Decl(findLast.ts, 9, 29))
new Float64Array().findLast((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 10, 29))
>item : Symbol(item, Decl(findLast.ts, 10, 29))
new BigInt64Array().findLast((item) => item === BigInt(0));
>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 11, 30))
>item : Symbol(item, Decl(findLast.ts, 11, 30))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
new BigUint64Array().findLast((item) => item === BigInt(0));
>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 12, 31))
>item : Symbol(item, Decl(findLast.ts, 12, 31))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
const indexNumber: number = [0].findLastIndex((item) => item === 0);
>indexNumber : Symbol(indexNumber, Decl(findLast.ts, 14, 5))
>item : Symbol(item, Decl(findLast.ts, 14, 47))
>item : Symbol(item, Decl(findLast.ts, 14, 47))
const indexString: number = ["string"].findLastIndex((item) => item === "string");
>indexString : Symbol(indexString, Decl(findLast.ts, 15, 5))
>item : Symbol(item, Decl(findLast.ts, 15, 54))
>item : Symbol(item, Decl(findLast.ts, 15, 54))
new Int8Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 16, 31))
>item : Symbol(item, Decl(findLast.ts, 16, 31))
new Uint8Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 17, 32))
>item : Symbol(item, Decl(findLast.ts, 17, 32))
new Uint8ClampedArray().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 18, 39))
>item : Symbol(item, Decl(findLast.ts, 18, 39))
new Int16Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 19, 32))
>item : Symbol(item, Decl(findLast.ts, 19, 32))
new Uint16Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 20, 33))
>item : Symbol(item, Decl(findLast.ts, 20, 33))
new Int32Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 21, 32))
>item : Symbol(item, Decl(findLast.ts, 21, 32))
new Uint32Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 22, 33))
>item : Symbol(item, Decl(findLast.ts, 22, 33))
new Float32Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 23, 34))
>item : Symbol(item, Decl(findLast.ts, 23, 34))
new Float64Array().findLastIndex((item) => item === 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, --, --) ... and 1 more)
>item : Symbol(item, Decl(findLast.ts, 24, 34))
>item : Symbol(item, Decl(findLast.ts, 24, 34))
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 25, 35))
>item : Symbol(item, Decl(findLast.ts, 25, 35))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 26, 36))
>item : Symbol(item, Decl(findLast.ts, 26, 36))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
@@ -0,0 +1,325 @@
=== tests/cases/compiler/findLast.ts ===
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
>itemNumber : number
>[0].findLast((item) => item === 0) : any
>[0].findLast : any
>[0] : number[]
>0 : 0
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
const itemString: string | undefined = ["string"].findLast((item) => item === "string");
>itemString : string
>["string"].findLast((item) => item === "string") : any
>["string"].findLast : any
>["string"] : string[]
>"string" : "string"
>findLast : any
>(item) => item === "string" : (item: any) => boolean
>item : any
>item === "string" : boolean
>item : any
>"string" : "string"
new Int8Array().findLast((item) => item === 0);
>new Int8Array().findLast((item) => item === 0) : any
>new Int8Array().findLast : any
>new Int8Array() : Int8Array
>Int8Array : Int8ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint8Array().findLast((item) => item === 0);
>new Uint8Array().findLast((item) => item === 0) : any
>new Uint8Array().findLast : any
>new Uint8Array() : Uint8Array
>Uint8Array : Uint8ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint8ClampedArray().findLast((item) => item === 0);
>new Uint8ClampedArray().findLast((item) => item === 0) : any
>new Uint8ClampedArray().findLast : any
>new Uint8ClampedArray() : Uint8ClampedArray
>Uint8ClampedArray : Uint8ClampedArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Int16Array().findLast((item) => item === 0);
>new Int16Array().findLast((item) => item === 0) : any
>new Int16Array().findLast : any
>new Int16Array() : Int16Array
>Int16Array : Int16ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint16Array().findLast((item) => item === 0);
>new Uint16Array().findLast((item) => item === 0) : any
>new Uint16Array().findLast : any
>new Uint16Array() : Uint16Array
>Uint16Array : Uint16ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Int32Array().findLast((item) => item === 0);
>new Int32Array().findLast((item) => item === 0) : any
>new Int32Array().findLast : any
>new Int32Array() : Int32Array
>Int32Array : Int32ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint32Array().findLast((item) => item === 0);
>new Uint32Array().findLast((item) => item === 0) : any
>new Uint32Array().findLast : any
>new Uint32Array() : Uint32Array
>Uint32Array : Uint32ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Float32Array().findLast((item) => item === 0);
>new Float32Array().findLast((item) => item === 0) : any
>new Float32Array().findLast : any
>new Float32Array() : Float32Array
>Float32Array : Float32ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Float64Array().findLast((item) => item === 0);
>new Float64Array().findLast((item) => item === 0) : any
>new Float64Array().findLast : any
>new Float64Array() : Float64Array
>Float64Array : Float64ArrayConstructor
>findLast : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new BigInt64Array().findLast((item) => item === BigInt(0));
>new BigInt64Array().findLast((item) => item === BigInt(0)) : any
>new BigInt64Array().findLast : any
>new BigInt64Array() : BigInt64Array
>BigInt64Array : BigInt64ArrayConstructor
>findLast : any
>(item) => item === BigInt(0) : (item: any) => boolean
>item : any
>item === BigInt(0) : boolean
>item : any
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
new BigUint64Array().findLast((item) => item === BigInt(0));
>new BigUint64Array().findLast((item) => item === BigInt(0)) : any
>new BigUint64Array().findLast : any
>new BigUint64Array() : BigUint64Array
>BigUint64Array : BigUint64ArrayConstructor
>findLast : any
>(item) => item === BigInt(0) : (item: any) => boolean
>item : any
>item === BigInt(0) : boolean
>item : any
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
const indexNumber: number = [0].findLastIndex((item) => item === 0);
>indexNumber : number
>[0].findLastIndex((item) => item === 0) : any
>[0].findLastIndex : any
>[0] : number[]
>0 : 0
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
const indexString: number = ["string"].findLastIndex((item) => item === "string");
>indexString : number
>["string"].findLastIndex((item) => item === "string") : any
>["string"].findLastIndex : any
>["string"] : string[]
>"string" : "string"
>findLastIndex : any
>(item) => item === "string" : (item: any) => boolean
>item : any
>item === "string" : boolean
>item : any
>"string" : "string"
new Int8Array().findLastIndex((item) => item === 0);
>new Int8Array().findLastIndex((item) => item === 0) : any
>new Int8Array().findLastIndex : any
>new Int8Array() : Int8Array
>Int8Array : Int8ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint8Array().findLastIndex((item) => item === 0);
>new Uint8Array().findLastIndex((item) => item === 0) : any
>new Uint8Array().findLastIndex : any
>new Uint8Array() : Uint8Array
>Uint8Array : Uint8ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint8ClampedArray().findLastIndex((item) => item === 0);
>new Uint8ClampedArray().findLastIndex((item) => item === 0) : any
>new Uint8ClampedArray().findLastIndex : any
>new Uint8ClampedArray() : Uint8ClampedArray
>Uint8ClampedArray : Uint8ClampedArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Int16Array().findLastIndex((item) => item === 0);
>new Int16Array().findLastIndex((item) => item === 0) : any
>new Int16Array().findLastIndex : any
>new Int16Array() : Int16Array
>Int16Array : Int16ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint16Array().findLastIndex((item) => item === 0);
>new Uint16Array().findLastIndex((item) => item === 0) : any
>new Uint16Array().findLastIndex : any
>new Uint16Array() : Uint16Array
>Uint16Array : Uint16ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Int32Array().findLastIndex((item) => item === 0);
>new Int32Array().findLastIndex((item) => item === 0) : any
>new Int32Array().findLastIndex : any
>new Int32Array() : Int32Array
>Int32Array : Int32ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Uint32Array().findLastIndex((item) => item === 0);
>new Uint32Array().findLastIndex((item) => item === 0) : any
>new Uint32Array().findLastIndex : any
>new Uint32Array() : Uint32Array
>Uint32Array : Uint32ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Float32Array().findLastIndex((item) => item === 0);
>new Float32Array().findLastIndex((item) => item === 0) : any
>new Float32Array().findLastIndex : any
>new Float32Array() : Float32Array
>Float32Array : Float32ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new Float64Array().findLastIndex((item) => item === 0);
>new Float64Array().findLastIndex((item) => item === 0) : any
>new Float64Array().findLastIndex : any
>new Float64Array() : Float64Array
>Float64Array : Float64ArrayConstructor
>findLastIndex : any
>(item) => item === 0 : (item: any) => boolean
>item : any
>item === 0 : boolean
>item : any
>0 : 0
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
>new BigInt64Array().findLastIndex((item) => item === BigInt(0)) : any
>new BigInt64Array().findLastIndex : any
>new BigInt64Array() : BigInt64Array
>BigInt64Array : BigInt64ArrayConstructor
>findLastIndex : any
>(item) => item === BigInt(0) : (item: any) => boolean
>item : any
>item === BigInt(0) : boolean
>item : any
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
>new BigUint64Array().findLastIndex((item) => item === BigInt(0)) : any
>new BigUint64Array().findLastIndex : any
>new BigUint64Array() : BigUint64Array
>BigUint64Array : BigUint64ArrayConstructor
>findLastIndex : any
>(item) => item === BigInt(0) : (item: any) => boolean
>item : any
>item === BigInt(0) : boolean
>item : any
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
@@ -0,0 +1,57 @@
//// [findLast.ts]
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
const itemString: string | undefined = ["string"].findLast((item) => item === "string");
new Int8Array().findLast((item) => item === 0);
new Uint8Array().findLast((item) => item === 0);
new Uint8ClampedArray().findLast((item) => item === 0);
new Int16Array().findLast((item) => item === 0);
new Uint16Array().findLast((item) => item === 0);
new Int32Array().findLast((item) => item === 0);
new Uint32Array().findLast((item) => item === 0);
new Float32Array().findLast((item) => item === 0);
new Float64Array().findLast((item) => item === 0);
new BigInt64Array().findLast((item) => item === BigInt(0));
new BigUint64Array().findLast((item) => item === BigInt(0));
const indexNumber: number = [0].findLastIndex((item) => item === 0);
const indexString: number = ["string"].findLastIndex((item) => item === "string");
new Int8Array().findLastIndex((item) => item === 0);
new Uint8Array().findLastIndex((item) => item === 0);
new Uint8ClampedArray().findLastIndex((item) => item === 0);
new Int16Array().findLastIndex((item) => item === 0);
new Uint16Array().findLastIndex((item) => item === 0);
new Int32Array().findLastIndex((item) => item === 0);
new Uint32Array().findLastIndex((item) => item === 0);
new Float32Array().findLastIndex((item) => item === 0);
new Float64Array().findLastIndex((item) => item === 0);
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
//// [findLast.js]
const itemNumber = [0].findLast((item) => item === 0);
const itemString = ["string"].findLast((item) => item === "string");
new Int8Array().findLast((item) => item === 0);
new Uint8Array().findLast((item) => item === 0);
new Uint8ClampedArray().findLast((item) => item === 0);
new Int16Array().findLast((item) => item === 0);
new Uint16Array().findLast((item) => item === 0);
new Int32Array().findLast((item) => item === 0);
new Uint32Array().findLast((item) => item === 0);
new Float32Array().findLast((item) => item === 0);
new Float64Array().findLast((item) => item === 0);
new BigInt64Array().findLast((item) => item === BigInt(0));
new BigUint64Array().findLast((item) => item === BigInt(0));
const indexNumber = [0].findLastIndex((item) => item === 0);
const indexString = ["string"].findLastIndex((item) => item === "string");
new Int8Array().findLastIndex((item) => item === 0);
new Uint8Array().findLastIndex((item) => item === 0);
new Uint8ClampedArray().findLastIndex((item) => item === 0);
new Int16Array().findLastIndex((item) => item === 0);
new Uint16Array().findLastIndex((item) => item === 0);
new Int32Array().findLastIndex((item) => item === 0);
new Uint32Array().findLastIndex((item) => item === 0);
new Float32Array().findLastIndex((item) => item === 0);
new Float64Array().findLastIndex((item) => item === 0);
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
@@ -0,0 +1,187 @@
=== tests/cases/compiler/findLast.ts ===
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
>itemNumber : Symbol(itemNumber, Decl(findLast.ts, 0, 5))
>[0].findLast : Symbol(Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>findLast : Symbol(Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 0, 53))
>item : Symbol(item, Decl(findLast.ts, 0, 53))
const itemString: string | undefined = ["string"].findLast((item) => item === "string");
>itemString : Symbol(itemString, Decl(findLast.ts, 1, 5))
>["string"].findLast : Symbol(Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>findLast : Symbol(Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 1, 60))
>item : Symbol(item, Decl(findLast.ts, 1, 60))
new Int8Array().findLast((item) => item === 0);
>new Int8Array().findLast : Symbol(Int8Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Int8Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 2, 26))
>item : Symbol(item, Decl(findLast.ts, 2, 26))
new Uint8Array().findLast((item) => item === 0);
>new Uint8Array().findLast : Symbol(Uint8Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Uint8Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 3, 27))
>item : Symbol(item, Decl(findLast.ts, 3, 27))
new Uint8ClampedArray().findLast((item) => item === 0);
>new Uint8ClampedArray().findLast : Symbol(Uint8ClampedArray.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Uint8ClampedArray.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 4, 34))
>item : Symbol(item, Decl(findLast.ts, 4, 34))
new Int16Array().findLast((item) => item === 0);
>new Int16Array().findLast : Symbol(Int16Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Int16Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 5, 27))
>item : Symbol(item, Decl(findLast.ts, 5, 27))
new Uint16Array().findLast((item) => item === 0);
>new Uint16Array().findLast : Symbol(Uint16Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Uint16Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 6, 28))
>item : Symbol(item, Decl(findLast.ts, 6, 28))
new Int32Array().findLast((item) => item === 0);
>new Int32Array().findLast : Symbol(Int32Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Int32Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 7, 27))
>item : Symbol(item, Decl(findLast.ts, 7, 27))
new Uint32Array().findLast((item) => item === 0);
>new Uint32Array().findLast : Symbol(Uint32Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Uint32Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 8, 28))
>item : Symbol(item, Decl(findLast.ts, 8, 28))
new Float32Array().findLast((item) => item === 0);
>new Float32Array().findLast : Symbol(Float32Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Float32Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 9, 29))
>item : Symbol(item, Decl(findLast.ts, 9, 29))
new Float64Array().findLast((item) => item === 0);
>new Float64Array().findLast : Symbol(Float64Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.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 2 more)
>findLast : Symbol(Float64Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 10, 29))
>item : Symbol(item, Decl(findLast.ts, 10, 29))
new BigInt64Array().findLast((item) => item === BigInt(0));
>new BigInt64Array().findLast : Symbol(BigInt64Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>findLast : Symbol(BigInt64Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 11, 30))
>item : Symbol(item, Decl(findLast.ts, 11, 30))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
new BigUint64Array().findLast((item) => item === BigInt(0));
>new BigUint64Array().findLast : Symbol(BigUint64Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>findLast : Symbol(BigUint64Array.findLast, Decl(lib.es2023.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 12, 31))
>item : Symbol(item, Decl(findLast.ts, 12, 31))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
const indexNumber: number = [0].findLastIndex((item) => item === 0);
>indexNumber : Symbol(indexNumber, Decl(findLast.ts, 14, 5))
>[0].findLastIndex : Symbol(Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>findLastIndex : Symbol(Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 14, 47))
>item : Symbol(item, Decl(findLast.ts, 14, 47))
const indexString: number = ["string"].findLastIndex((item) => item === "string");
>indexString : Symbol(indexString, Decl(findLast.ts, 15, 5))
>["string"].findLastIndex : Symbol(Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>findLastIndex : Symbol(Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 15, 54))
>item : Symbol(item, Decl(findLast.ts, 15, 54))
new Int8Array().findLastIndex((item) => item === 0);
>new Int8Array().findLastIndex : Symbol(Int8Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Int8Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 16, 31))
>item : Symbol(item, Decl(findLast.ts, 16, 31))
new Uint8Array().findLastIndex((item) => item === 0);
>new Uint8Array().findLastIndex : Symbol(Uint8Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Uint8Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 17, 32))
>item : Symbol(item, Decl(findLast.ts, 17, 32))
new Uint8ClampedArray().findLastIndex((item) => item === 0);
>new Uint8ClampedArray().findLastIndex : Symbol(Uint8ClampedArray.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Uint8ClampedArray.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 18, 39))
>item : Symbol(item, Decl(findLast.ts, 18, 39))
new Int16Array().findLastIndex((item) => item === 0);
>new Int16Array().findLastIndex : Symbol(Int16Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Int16Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 19, 32))
>item : Symbol(item, Decl(findLast.ts, 19, 32))
new Uint16Array().findLastIndex((item) => item === 0);
>new Uint16Array().findLastIndex : Symbol(Uint16Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Uint16Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 20, 33))
>item : Symbol(item, Decl(findLast.ts, 20, 33))
new Int32Array().findLastIndex((item) => item === 0);
>new Int32Array().findLastIndex : Symbol(Int32Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Int32Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 21, 32))
>item : Symbol(item, Decl(findLast.ts, 21, 32))
new Uint32Array().findLastIndex((item) => item === 0);
>new Uint32Array().findLastIndex : Symbol(Uint32Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Uint32Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 22, 33))
>item : Symbol(item, Decl(findLast.ts, 22, 33))
new Float32Array().findLastIndex((item) => item === 0);
>new Float32Array().findLastIndex : Symbol(Float32Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Float32Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 23, 34))
>item : Symbol(item, Decl(findLast.ts, 23, 34))
new Float64Array().findLastIndex((item) => item === 0);
>new Float64Array().findLastIndex : Symbol(Float64Array.findLastIndex, Decl(lib.es2023.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 2 more)
>findLastIndex : Symbol(Float64Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 24, 34))
>item : Symbol(item, Decl(findLast.ts, 24, 34))
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
>new BigInt64Array().findLastIndex : Symbol(BigInt64Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>findLastIndex : Symbol(BigInt64Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 25, 35))
>item : Symbol(item, Decl(findLast.ts, 25, 35))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
>new BigUint64Array().findLastIndex : Symbol(BigUint64Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --))
>findLastIndex : Symbol(BigUint64Array.findLastIndex, Decl(lib.es2023.array.d.ts, --, --))
>item : Symbol(item, Decl(findLast.ts, 26, 36))
>item : Symbol(item, Decl(findLast.ts, 26, 36))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
@@ -0,0 +1,325 @@
=== tests/cases/compiler/findLast.ts ===
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
>itemNumber : number
>[0].findLast((item) => item === 0) : number
>[0].findLast : { <S extends number>(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }
>[0] : number[]
>0 : 0
>findLast : { <S extends number>(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
const itemString: string | undefined = ["string"].findLast((item) => item === "string");
>itemString : string
>["string"].findLast((item) => item === "string") : string
>["string"].findLast : { <S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S; (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string; }
>["string"] : string[]
>"string" : "string"
>findLast : { <S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S; (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string; }
>(item) => item === "string" : (item: string) => boolean
>item : string
>item === "string" : boolean
>item : string
>"string" : "string"
new Int8Array().findLast((item) => item === 0);
>new Int8Array().findLast((item) => item === 0) : number
>new Int8Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Int8Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): number; }
>new Int8Array() : Int8Array
>Int8Array : Int8ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Int8Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint8Array().findLast((item) => item === 0);
>new Uint8Array().findLast((item) => item === 0) : number
>new Uint8Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint8Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number; }
>new Uint8Array() : Uint8Array
>Uint8Array : Uint8ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint8Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint8ClampedArray().findLast((item) => item === 0);
>new Uint8ClampedArray().findLast((item) => item === 0) : number
>new Uint8ClampedArray().findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint8ClampedArray) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): number; }
>new Uint8ClampedArray() : Uint8ClampedArray
>Uint8ClampedArray : Uint8ClampedArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint8ClampedArray) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Int16Array().findLast((item) => item === 0);
>new Int16Array().findLast((item) => item === 0) : number
>new Int16Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Int16Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): number; }
>new Int16Array() : Int16Array
>Int16Array : Int16ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Int16Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint16Array().findLast((item) => item === 0);
>new Uint16Array().findLast((item) => item === 0) : number
>new Uint16Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint16Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): number; }
>new Uint16Array() : Uint16Array
>Uint16Array : Uint16ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint16Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Int32Array().findLast((item) => item === 0);
>new Int32Array().findLast((item) => item === 0) : number
>new Int32Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Int32Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): number; }
>new Int32Array() : Int32Array
>Int32Array : Int32ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Int32Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint32Array().findLast((item) => item === 0);
>new Uint32Array().findLast((item) => item === 0) : number
>new Uint32Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint32Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): number; }
>new Uint32Array() : Uint32Array
>Uint32Array : Uint32ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Uint32Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Float32Array().findLast((item) => item === 0);
>new Float32Array().findLast((item) => item === 0) : number
>new Float32Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Float32Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): number; }
>new Float32Array() : Float32Array
>Float32Array : Float32ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Float32Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Float64Array().findLast((item) => item === 0);
>new Float64Array().findLast((item) => item === 0) : number
>new Float64Array().findLast : { <S extends number>(predicate: (value: number, index: number, array: Float64Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): number; }
>new Float64Array() : Float64Array
>Float64Array : Float64ArrayConstructor
>findLast : { <S extends number>(predicate: (value: number, index: number, array: Float64Array) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): number; }
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new BigInt64Array().findLast((item) => item === BigInt(0));
>new BigInt64Array().findLast((item) => item === BigInt(0)) : bigint
>new BigInt64Array().findLast : { <S extends bigint>(predicate: (value: bigint, index: number, array: BigInt64Array) => value is S, thisArg?: any): S; (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): bigint; }
>new BigInt64Array() : BigInt64Array
>BigInt64Array : BigInt64ArrayConstructor
>findLast : { <S extends bigint>(predicate: (value: bigint, index: number, array: BigInt64Array) => value is S, thisArg?: any): S; (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): bigint; }
>(item) => item === BigInt(0) : (item: bigint) => boolean
>item : bigint
>item === BigInt(0) : boolean
>item : bigint
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
new BigUint64Array().findLast((item) => item === BigInt(0));
>new BigUint64Array().findLast((item) => item === BigInt(0)) : bigint
>new BigUint64Array().findLast : { <S extends bigint>(predicate: (value: bigint, index: number, array: BigUint64Array) => value is S, thisArg?: any): S; (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): bigint; }
>new BigUint64Array() : BigUint64Array
>BigUint64Array : BigUint64ArrayConstructor
>findLast : { <S extends bigint>(predicate: (value: bigint, index: number, array: BigUint64Array) => value is S, thisArg?: any): S; (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): bigint; }
>(item) => item === BigInt(0) : (item: bigint) => boolean
>item : bigint
>item === BigInt(0) : boolean
>item : bigint
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
const indexNumber: number = [0].findLastIndex((item) => item === 0);
>indexNumber : number
>[0].findLastIndex((item) => item === 0) : number
>[0].findLastIndex : (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number
>[0] : number[]
>0 : 0
>findLastIndex : (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
const indexString: number = ["string"].findLastIndex((item) => item === "string");
>indexString : number
>["string"].findLastIndex((item) => item === "string") : number
>["string"].findLastIndex : (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => number
>["string"] : string[]
>"string" : "string"
>findLastIndex : (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => number
>(item) => item === "string" : (item: string) => boolean
>item : string
>item === "string" : boolean
>item : string
>"string" : "string"
new Int8Array().findLastIndex((item) => item === 0);
>new Int8Array().findLastIndex((item) => item === 0) : number
>new Int8Array().findLastIndex : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => number
>new Int8Array() : Int8Array
>Int8Array : Int8ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint8Array().findLastIndex((item) => item === 0);
>new Uint8Array().findLastIndex((item) => item === 0) : number
>new Uint8Array().findLastIndex : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => number
>new Uint8Array() : Uint8Array
>Uint8Array : Uint8ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint8ClampedArray().findLastIndex((item) => item === 0);
>new Uint8ClampedArray().findLastIndex((item) => item === 0) : number
>new Uint8ClampedArray().findLastIndex : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => number
>new Uint8ClampedArray() : Uint8ClampedArray
>Uint8ClampedArray : Uint8ClampedArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Int16Array().findLastIndex((item) => item === 0);
>new Int16Array().findLastIndex((item) => item === 0) : number
>new Int16Array().findLastIndex : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => number
>new Int16Array() : Int16Array
>Int16Array : Int16ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint16Array().findLastIndex((item) => item === 0);
>new Uint16Array().findLastIndex((item) => item === 0) : number
>new Uint16Array().findLastIndex : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => number
>new Uint16Array() : Uint16Array
>Uint16Array : Uint16ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Int32Array().findLastIndex((item) => item === 0);
>new Int32Array().findLastIndex((item) => item === 0) : number
>new Int32Array().findLastIndex : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => number
>new Int32Array() : Int32Array
>Int32Array : Int32ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Uint32Array().findLastIndex((item) => item === 0);
>new Uint32Array().findLastIndex((item) => item === 0) : number
>new Uint32Array().findLastIndex : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => number
>new Uint32Array() : Uint32Array
>Uint32Array : Uint32ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Float32Array().findLastIndex((item) => item === 0);
>new Float32Array().findLastIndex((item) => item === 0) : number
>new Float32Array().findLastIndex : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => number
>new Float32Array() : Float32Array
>Float32Array : Float32ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new Float64Array().findLastIndex((item) => item === 0);
>new Float64Array().findLastIndex((item) => item === 0) : number
>new Float64Array().findLastIndex : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => number
>new Float64Array() : Float64Array
>Float64Array : Float64ArrayConstructor
>findLastIndex : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => number
>(item) => item === 0 : (item: number) => boolean
>item : number
>item === 0 : boolean
>item : number
>0 : 0
new BigInt64Array().findLastIndex((item) => item === BigInt(0));
>new BigInt64Array().findLastIndex((item) => item === BigInt(0)) : number
>new BigInt64Array().findLastIndex : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => number
>new BigInt64Array() : BigInt64Array
>BigInt64Array : BigInt64ArrayConstructor
>findLastIndex : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => number
>(item) => item === BigInt(0) : (item: bigint) => boolean
>item : bigint
>item === BigInt(0) : boolean
>item : bigint
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
new BigUint64Array().findLastIndex((item) => item === BigInt(0));
>new BigUint64Array().findLastIndex((item) => item === BigInt(0)) : number
>new BigUint64Array().findLastIndex : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => number
>new BigUint64Array() : BigUint64Array
>BigUint64Array : BigUint64ArrayConstructor
>findLastIndex : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => number
>(item) => item === BigInt(0) : (item: bigint) => boolean
>item : bigint
>item === BigInt(0) : boolean
>item : bigint
>BigInt(0) : bigint
>BigInt : BigIntConstructor
>0 : 0
+1 -1
View File
@@ -1,4 +1,4 @@
// @target: esnext
// @target: esnext, es2022
const itemNumber: number | undefined = [0].findLast((item) => item === 0);
const itemString: string | undefined = ["string"].findLast((item) => item === "string");