Skip to content

Add target: "es2022" #46291

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 10 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "optional parameter"
This reverts commit e67d6e5.
  • Loading branch information
saschanaz committed Oct 29, 2021
commit f384243b48ef87436fffc9b0d24cf331b8e6e6c3
26 changes: 13 additions & 13 deletions src/lib/es2022.array.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,101 +3,101 @@ interface Array<T> {
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): T;
at(index: number): T;
}

interface ReadonlyArray<T> {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): T;
at(index: number): T;
}

interface Int8Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Uint8Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Uint8ClampedArray {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Int16Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Uint16Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Int32Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Uint32Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Float32Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface Float64Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface BigInt64Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}

interface BigUint64Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index?: number): number;
at(index: number): number;
}
2 changes: 1 addition & 1 deletion src/lib/es2022.string.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
55 changes: 1 addition & 54 deletions tests/baselines/reference/indexAt(target=es2021).errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,9 @@ 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 (26 errors) ====
==== tests/cases/compiler/indexAt.ts (13 errors) ====
[0].at(0);
~~
!!! error TS2550: Property 'at' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.
Expand Down Expand Up @@ -66,44 +53,4 @@ tests/cases/compiler/indexAt.ts(27,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.

27 changes: 0 additions & 27 deletions tests/baselines/reference/indexAt(target=es2021).js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ 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]
Expand All @@ -42,16 +28,3 @@ 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();
35 changes: 0 additions & 35 deletions tests/baselines/reference/indexAt(target=es2021).symbols
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,3 @@ 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, --, --))

90 changes: 0 additions & 90 deletions tests/baselines/reference/indexAt(target=es2021).types
Original file line number Diff line number Diff line change
Expand Up @@ -102,93 +102,3 @@ 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

Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy