-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add target: "es2022"
#46291
Changes from 6 commits
5b7da72
63a65d7
c940acb
f28a433
c341cd7
e67d6e5
f384243
95b4ad8
5ebce82
2c91268
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| interface Array<T> { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): T; | ||
|
||
| } | ||
|
|
||
| interface ReadonlyArray<T> { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): T; | ||
| } | ||
|
|
||
| interface Int8Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Uint8Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Uint8ClampedArray { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Int16Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Uint16Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Int32Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Uint32Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Float32Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface Float64Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface BigInt64Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
|
|
||
| interface BigUint64Array { | ||
| /** | ||
| * Returns the item located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): number; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /// <reference lib="es2021" /> | ||
| /// <reference lib="es2022.array" /> | ||
| /// <reference lib="es2022.object" /> | ||
| /// <reference lib="es2022.string" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| /// <reference lib="es2022" /> | ||
| /// <reference lib="dom" /> | ||
| /// <reference lib="webworker.importscripts" /> | ||
| /// <reference lib="scripthost" /> | ||
| /// <reference lib="dom.iterable" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| interface Object { | ||
| /** | ||
| * Determines whether an object has a property with the specified name. | ||
| * @param o An object. | ||
| * @param v A property name. | ||
| */ | ||
| hasOwn(o: object, v: PropertyKey): boolean; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| interface String { | ||
| /** | ||
| * Returns a new String consisting of the single UTF-16 code unit located at the specified index. | ||
| * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
| */ | ||
| at(index?: number): string; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| /// <reference lib="es2021" /> | ||
| /// <reference lib="es2022" /> | ||
| /// <reference lib="esnext.intl" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| //// [callChainWithSuper.ts] | ||
| // GH#34952 | ||
| class Base { method?() {} } | ||
| class Derived extends Base { | ||
| method1() { return super.method?.(); } | ||
| method2() { return super["method"]?.(); } | ||
| } | ||
|
|
||
| //// [callChainWithSuper.js] | ||
| "use strict"; | ||
| // GH#34952 | ||
| class Base { | ||
| method() { } | ||
| } | ||
| class Derived extends Base { | ||
| method1() { return super.method?.(); } | ||
| method2() { return super["method"]?.(); } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ES2022 does not contain new syntax, should we skip
ContainsES2022flag (or setContainsES2022=ContainsES2021) to save the bitflag?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are (notably class private fields), but just not here yet AFAIK.