-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Add 2023 array methods to target features #52242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cf9fdb6
Add 2023 array methods to target features
OliverRadini 6ad5a9c
Merge branch 'microsoft:main' into main
OliverRadini f972aab
Add es2022 target to findLast tests
OliverRadini 2030da7
Add es2022 baseline files for findLast
OliverRadini 8ee1319
Merge branch 'microsoft:main' into main
OliverRadini 254e91b
Merge branch 'microsoft:main' into main
OliverRadini bb6b882
Merge branch 'microsoft:main' into main
OliverRadini c164b35
Merge branch 'microsoft:main' into main
OliverRadini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
tests/baselines/reference/findLast(target=es2022).errors.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.