diff --git a/.github/workflows/accept-baselines-fix-lints.yaml b/.github/workflows/accept-baselines-fix-lints.yaml
index 2662646cc05fe..d0196d1e29206 100644
--- a/.github/workflows/accept-baselines-fix-lints.yaml
+++ b/.github/workflows/accept-baselines-fix-lints.yaml
@@ -9,11 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Use node version 14
- uses: actions/setup-node@v3
- with:
- node-version: 14
- registry-url: https://registry.npmjs.org/
+ - uses: actions/setup-node@v3
- name: Configure Git, Run Tests, Update Baselines, Apply Fixes
run: |
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b95b0481ed251..3ea0ee5a4eb82 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,7 +16,11 @@ jobs:
strategy:
matrix:
- node-version: [14.x, 16.x, 18.x]
+ # Test the latest version of Node.js plus the last two LTS versions.
+ node-version:
+ - "*"
+ - lts/*
+ - lts/-1
steps:
- uses: actions/checkout@v3
@@ -26,6 +30,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
+ check-latest: true
- name: Remove existing TypeScript
run: |
npm uninstall typescript --no-save
@@ -47,4 +52,3 @@ jobs:
- name: Validate the browser can import TypeScript
run: gulp test-browser-integration
-
diff --git a/.github/workflows/new-release-branch.yaml b/.github/workflows/new-release-branch.yaml
index 90b8bbdf5efdb..fa1d0a070750d 100644
--- a/.github/workflows/new-release-branch.yaml
+++ b/.github/workflows/new-release-branch.yaml
@@ -9,10 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Use node version 14.x
- uses: actions/setup-node@v3
- with:
- node-version: 14.x
+ - uses: actions/setup-node@v3
- uses: actions/checkout@v2
with:
fetch-depth: 5
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml
index d255a324f7947..6333c75b4b052 100644
--- a/.github/workflows/nightly.yaml
+++ b/.github/workflows/nightly.yaml
@@ -15,11 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Use node version 14
- uses: actions/setup-node@v3
- with:
- node-version: 14
- registry-url: https://registry.npmjs.org/
+ - uses: actions/setup-node@v3
- name: Setup and publish nightly
run: |
npm whoami
@@ -30,6 +26,4 @@ jobs:
gulp clean
npm publish --tag next
env:
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- CI: true
-
+ NPM_TOKEN: ${{secrets.npm_token}}
diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml
index 17bb3be4680d6..4e1578ecd460f 100644
--- a/.github/workflows/release-branch-artifact.yaml
+++ b/.github/workflows/release-branch-artifact.yaml
@@ -11,10 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Use node version 14
- uses: actions/setup-node@v3
- with:
- node-version: 14
+ - uses: actions/setup-node@v3
- name: Remove existing TypeScript
run: |
npm uninstall typescript --no-save
@@ -23,10 +20,8 @@ jobs:
run: |
npm ci
npm test
- env:
- CI: true
- name: Adding playwright
- run: npm install --no-save --no-package-lock playwright
+ run: npm install --no-save --no-package-lock playwright
- name: Validate the browser can import TypeScript
run: gulp test-browser-integration
- name: LKG, clean, and pack
@@ -35,8 +30,6 @@ jobs:
gulp clean
npm pack ./
mv typescript-*.tgz typescript.tgz
- env:
- CI: true
- name: Upload built tarfile
uses: actions/upload-artifact@v1
with:
diff --git a/.github/workflows/rich-navigation.yml b/.github/workflows/rich-navigation.yml
index 82ba9bf54f1df..1c955f5973461 100644
--- a/.github/workflows/rich-navigation.yml
+++ b/.github/workflows/rich-navigation.yml
@@ -20,8 +20,6 @@ jobs:
fetch-depth: 5
- uses: actions/setup-node@v3
- with:
- node-version: 14
- name: Install dependencies
run: npm ci
diff --git a/.github/workflows/set-version.yaml b/.github/workflows/set-version.yaml
index 5b1338daff2aa..567fba84e030e 100644
--- a/.github/workflows/set-version.yaml
+++ b/.github/workflows/set-version.yaml
@@ -9,10 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Use node version 14.x
- uses: actions/setup-node@v3
- with:
- node-version: 14.x
+ - uses: actions/setup-node@v3
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.branch_name }}
diff --git a/.github/workflows/sync-branch.yaml b/.github/workflows/sync-branch.yaml
index fae67017c617b..2928d072348e3 100644
--- a/.github/workflows/sync-branch.yaml
+++ b/.github/workflows/sync-branch.yaml
@@ -14,10 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Use node version 14.x
- uses: actions/setup-node@v3
- with:
- node-version: 14.x
+ - uses: actions/setup-node@v3
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml
index 36a97b49ac5ce..3ff59cf2e56e2 100644
--- a/.github/workflows/twoslash-repros.yaml
+++ b/.github/workflows/twoslash-repros.yaml
@@ -23,12 +23,11 @@ jobs:
if: ${{ github.repository == 'microsoft/TypeScript' && !github.event.label && !github.event.inputs.bisect_issue }}
runs-on: ubuntu-latest
steps:
- - name: Use node
- uses: actions/setup-node@v3
+ - uses: actions/setup-node@v3
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
- with:
+ with:
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
-
+
bisect:
if: ${{ github.event.label.name == 'Bisect Repro' || github.event.inputs.bisect_issue }}
runs-on: ubuntu-latest
@@ -37,9 +36,7 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- with:
- node-version: 16
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
- with:
+ with:
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
bisect: ${{ github.event.issue.number || github.event.inputs.bisect_issue }}
diff --git a/.github/workflows/update-lkg.yml b/.github/workflows/update-lkg.yml
index cac9c6c4c0665..53e3aaa750aa8 100644
--- a/.github/workflows/update-lkg.yml
+++ b/.github/workflows/update-lkg.yml
@@ -9,11 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Use node version 14
- uses: actions/setup-node@v3
- with:
- node-version: 14
- registry-url: https://registry.npmjs.org/
+ - uses: actions/setup-node@v3
- name: Configure Git and Update LKG
run: |
diff --git a/.github/workflows/update-package-lock.yaml b/.github/workflows/update-package-lock.yaml
index 1c54603f9ba1c..da64c80daccc8 100644
--- a/.github/workflows/update-package-lock.yaml
+++ b/.github/workflows/update-package-lock.yaml
@@ -15,9 +15,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- with:
- node-version: 14
- registry-url: https://registry.npmjs.org/
- name: Configure git and update package-lock.json
run: |
diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts
index 09705e74f26eb..8d58bffaeb9c1 100644
--- a/src/compiler/commandLineParser.ts
+++ b/src/compiler/commandLineParser.ts
@@ -83,6 +83,7 @@ namespace ts {
["es2022.error", "lib.es2022.error.d.ts"],
["es2022.intl", "lib.es2022.intl.d.ts"],
["es2022.object", "lib.es2022.object.d.ts"],
+ ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"],
["es2022.string", "lib.es2022.string.d.ts"],
["esnext.array", "lib.es2022.array.d.ts"],
["esnext.symbol", "lib.es2019.symbol.d.ts"],
diff --git a/src/lib/es2022.d.ts b/src/lib/es2022.d.ts
index 7069e4ecdf1e9..28b66165e22c9 100644
--- a/src/lib/es2022.d.ts
+++ b/src/lib/es2022.d.ts
@@ -3,4 +3,5 @@
///
///
///
+///
///
diff --git a/src/lib/es2022.sharedmemory.d.ts b/src/lib/es2022.sharedmemory.d.ts
new file mode 100644
index 0000000000000..ea56abe980bfe
--- /dev/null
+++ b/src/lib/es2022.sharedmemory.d.ts
@@ -0,0 +1,7 @@
+interface Atomics {
+ /**
+ * A non-blocking, asynchronous version of wait which is usable on the main thread.
+ * Waits asynchronously on a shared memory location and returns a Promise
+ */
+ waitAsync(typedArray: BigInt64Array | Int32Array, index: number, value: bigint, timeout?: number): { async: false, value: "ok" | "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "not-equal" | "timed-out"> };
+}
diff --git a/src/lib/libs.json b/src/lib/libs.json
index ad01b1dff2c9b..305c6e3030a90 100644
--- a/src/lib/libs.json
+++ b/src/lib/libs.json
@@ -59,6 +59,7 @@
"es2022.error",
"es2022.intl",
"es2022.object",
+ "es2022.sharedmemory",
"es2022.string",
"esnext.intl",
// Default libraries
diff --git a/src/services/refactors/convertExport.ts b/src/services/refactors/convertExport.ts
index 738731a5c8aca..0a40cf9542078 100644
--- a/src/services/refactors/convertExport.ts
+++ b/src/services/refactors/convertExport.ts
@@ -65,8 +65,8 @@ namespace ts.refactor {
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_export_statement) };
}
- const exportingModuleSymbol = isSourceFile(exportNode.parent) ? exportNode.parent.symbol : exportNode.parent.parent.symbol;
-
+ const checker = program.getTypeChecker();
+ const exportingModuleSymbol = getExportingModuleSymbol(exportNode, checker);
const flags = getSyntacticModifierFlags(exportNode) || ((isExportAssignment(exportNode) && !exportNode.isExportEquals) ? ModifierFlags.ExportDefault : ModifierFlags.None);
const wasDefault = !!(flags & ModifierFlags.Default);
@@ -75,7 +75,6 @@ namespace ts.refactor {
return { error: getLocaleSpecificMessage(Diagnostics.This_file_already_has_a_default_export) };
}
- const checker = program.getTypeChecker();
const noSymbolError = (id: Node) =>
(isIdentifier(id) && checker.getSymbolAtLocation(id)) ? undefined
: { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) };
@@ -165,6 +164,7 @@ namespace ts.refactor {
const checker = program.getTypeChecker();
const exportSymbol = Debug.checkDefined(checker.getSymbolAtLocation(exportName), "Export name should resolve to a symbol");
FindAllReferences.Core.eachExportReference(program.getSourceFiles(), checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName.text, wasDefault, ref => {
+ if (exportName === ref) return;
const importingSourceFile = ref.getSourceFile();
if (wasDefault) {
changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName.text);
@@ -262,4 +262,16 @@ namespace ts.refactor {
function makeExportSpecifier(propertyName: string, name: string): ExportSpecifier {
return factory.createExportSpecifier(/*isTypeOnly*/ false, propertyName === name ? undefined : factory.createIdentifier(propertyName), factory.createIdentifier(name));
}
+
+ function getExportingModuleSymbol(node: Node, checker: TypeChecker) {
+ const parent = node.parent;
+ if (isSourceFile(parent)) {
+ return parent.symbol;
+ }
+ const symbol = parent.parent.symbol;
+ if (symbol.valueDeclaration && isExternalModuleAugmentation(symbol.valueDeclaration)) {
+ return checker.getMergedSymbol(symbol);
+ }
+ return symbol;
+ }
}
diff --git a/tests/baselines/reference/es2022SharedMemory.symbols b/tests/baselines/reference/es2022SharedMemory.symbols
new file mode 100644
index 0000000000000..8eedea4a5bed0
--- /dev/null
+++ b/tests/baselines/reference/es2022SharedMemory.symbols
@@ -0,0 +1,42 @@
+=== tests/cases/conformance/es2022/es2022SharedMemory.ts ===
+const sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 1024);
+>sab : Symbol(sab, Decl(es2022SharedMemory.ts, 0, 5))
+>SharedArrayBuffer : Symbol(SharedArrayBuffer, Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2017.sharedmemory.d.ts, --, --))
+>Int32Array.BYTES_PER_ELEMENT : Symbol(Int32ArrayConstructor.BYTES_PER_ELEMENT, Decl(lib.es5.d.ts, --, --))
+>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 1 more)
+>BYTES_PER_ELEMENT : Symbol(Int32ArrayConstructor.BYTES_PER_ELEMENT, Decl(lib.es5.d.ts, --, --))
+
+const int32 = new Int32Array(sab);
+>int32 : Symbol(int32, Decl(es2022SharedMemory.ts, 1, 5))
+>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)
+>sab : Symbol(sab, Decl(es2022SharedMemory.ts, 0, 5))
+
+const waitValue = Atomics.wait(int32, 0, 0);
+>waitValue : Symbol(waitValue, Decl(es2022SharedMemory.ts, 2, 5))
+>Atomics.wait : Symbol(Atomics.wait, Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2020.sharedmemory.d.ts, --, --))
+>Atomics : Symbol(Atomics, Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2020.sharedmemory.d.ts, --, --), Decl(lib.es2022.sharedmemory.d.ts, --, --))
+>wait : Symbol(Atomics.wait, Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2020.sharedmemory.d.ts, --, --))
+>int32 : Symbol(int32, Decl(es2022SharedMemory.ts, 1, 5))
+
+const { async, value } = Atomics.waitAsync(int32, 0, BigInt(0));
+>async : Symbol(async, Decl(es2022SharedMemory.ts, 3, 7))
+>value : Symbol(value, Decl(es2022SharedMemory.ts, 3, 14))
+>Atomics.waitAsync : Symbol(Atomics.waitAsync, Decl(lib.es2022.sharedmemory.d.ts, --, --))
+>Atomics : Symbol(Atomics, Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2020.sharedmemory.d.ts, --, --), Decl(lib.es2022.sharedmemory.d.ts, --, --))
+>waitAsync : Symbol(Atomics.waitAsync, Decl(lib.es2022.sharedmemory.d.ts, --, --))
+>int32 : Symbol(int32, Decl(es2022SharedMemory.ts, 1, 5))
+>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
+
+const main = async () => {
+>main : Symbol(main, Decl(es2022SharedMemory.ts, 5, 5))
+
+ if (async) {
+>async : Symbol(async, Decl(es2022SharedMemory.ts, 3, 7))
+
+ await value;
+>value : Symbol(value, Decl(es2022SharedMemory.ts, 3, 14))
+ }
+}
+main();
+>main : Symbol(main, Decl(es2022SharedMemory.ts, 5, 5))
+
diff --git a/tests/baselines/reference/es2022SharedMemory.types b/tests/baselines/reference/es2022SharedMemory.types
new file mode 100644
index 0000000000000..d3bf7f66c016a
--- /dev/null
+++ b/tests/baselines/reference/es2022SharedMemory.types
@@ -0,0 +1,56 @@
+=== tests/cases/conformance/es2022/es2022SharedMemory.ts ===
+const sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 1024);
+>sab : SharedArrayBuffer
+>new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 1024) : SharedArrayBuffer
+>SharedArrayBuffer : SharedArrayBufferConstructor
+>Int32Array.BYTES_PER_ELEMENT * 1024 : number
+>Int32Array.BYTES_PER_ELEMENT : number
+>Int32Array : Int32ArrayConstructor
+>BYTES_PER_ELEMENT : number
+>1024 : 1024
+
+const int32 = new Int32Array(sab);
+>int32 : Int32Array
+>new Int32Array(sab) : Int32Array
+>Int32Array : Int32ArrayConstructor
+>sab : SharedArrayBuffer
+
+const waitValue = Atomics.wait(int32, 0, 0);
+>waitValue : "ok" | "not-equal" | "timed-out"
+>Atomics.wait(int32, 0, 0) : "ok" | "not-equal" | "timed-out"
+>Atomics.wait : { (typedArray: Int32Array, index: number, value: number, timeout?: number | undefined): "ok" | "not-equal" | "timed-out"; (typedArray: BigInt64Array, index: number, value: bigint, timeout?: number | undefined): "ok" | "not-equal" | "timed-out"; }
+>Atomics : Atomics
+>wait : { (typedArray: Int32Array, index: number, value: number, timeout?: number | undefined): "ok" | "not-equal" | "timed-out"; (typedArray: BigInt64Array, index: number, value: bigint, timeout?: number | undefined): "ok" | "not-equal" | "timed-out"; }
+>int32 : Int32Array
+>0 : 0
+>0 : 0
+
+const { async, value } = Atomics.waitAsync(int32, 0, BigInt(0));
+>async : boolean
+>value : "ok" | "not-equal" | "timed-out" | Promise<"ok" | "not-equal" | "timed-out">
+>Atomics.waitAsync(int32, 0, BigInt(0)) : { async: false; value: "ok" | "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "not-equal" | "timed-out">; }
+>Atomics.waitAsync : (typedArray: Int32Array | BigInt64Array, index: number, value: bigint, timeout?: number | undefined) => { async: false; value: "ok" | "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "not-equal" | "timed-out">; }
+>Atomics : Atomics
+>waitAsync : (typedArray: Int32Array | BigInt64Array, index: number, value: bigint, timeout?: number | undefined) => { async: false; value: "ok" | "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "not-equal" | "timed-out">; }
+>int32 : Int32Array
+>0 : 0
+>BigInt(0) : bigint
+>BigInt : BigIntConstructor
+>0 : 0
+
+const main = async () => {
+>main : () => Promise
+>async () => { if (async) { await value; }} : () => Promise
+
+ if (async) {
+>async : boolean
+
+ await value;
+>await value : "ok" | "not-equal" | "timed-out"
+>value : Promise<"ok" | "not-equal" | "timed-out">
+ }
+}
+main();
+>main() : Promise
+>main : () => Promise
+
diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json
index 7857b59fd0f8b..ac5303a7910d3 100644
--- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json
+++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json
@@ -147,5 +147,7 @@
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
+ "File '/package.json' does not exist according to earlier cached lookups.",
+ "File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups."
]
\ No newline at end of file
diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json
index 0e83601b1655e..ec1743f45c7a2 100644
--- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json
+++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json
@@ -141,5 +141,7 @@
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
+ "File '/package.json' does not exist according to earlier cached lookups.",
+ "File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups."
]
\ No newline at end of file
diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js
index e440d0f280127..257ae2c95017d 100644
--- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js
+++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js
@@ -90,7 +90,7 @@ default: undefined
--lib
Specify a set of bundled library declaration files that describe the target runtime environment.
-one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.string/esnext.string, esnext.intl
+one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, esnext.intl
default: undefined
--allowJs
diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js
index a7886b4d5b5e6..345d7b9679be2 100644
--- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js
+++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js
@@ -90,7 +90,7 @@ default: undefined
[94m--lib[39m
Specify a set of bundled library declaration files that describe the target runtime environment.
-one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.string/esnext.string, esnext.intl
+one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, esnext.intl
default: undefined
[94m--allowJs[39m
diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js
index a7886b4d5b5e6..345d7b9679be2 100644
--- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js
+++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js
@@ -90,7 +90,7 @@ default: undefined
[94m--lib[39m
Specify a set of bundled library declaration files that describe the target runtime environment.
-one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.string/esnext.string, esnext.intl
+one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, esnext.intl
default: undefined
[94m--allowJs[39m
diff --git a/tests/cases/conformance/es2022/es2022SharedMemory.ts b/tests/cases/conformance/es2022/es2022SharedMemory.ts
new file mode 100644
index 0000000000000..c28d50bbefd7a
--- /dev/null
+++ b/tests/cases/conformance/es2022/es2022SharedMemory.ts
@@ -0,0 +1,16 @@
+// @target: esnext
+// @lib: es2022
+// @noemit: true
+// @strict: true
+
+const sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 1024);
+const int32 = new Int32Array(sab);
+const waitValue = Atomics.wait(int32, 0, 0);
+const { async, value } = Atomics.waitAsync(int32, 0, BigInt(0));
+
+const main = async () => {
+ if (async) {
+ await value;
+ }
+}
+main();
\ No newline at end of file
diff --git a/tests/cases/fourslash/refactorConvertExport_namedToDefaultInModuleAugmentation1.ts b/tests/cases/fourslash/refactorConvertExport_namedToDefaultInModuleAugmentation1.ts
new file mode 100644
index 0000000000000..d1fc03349715e
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertExport_namedToDefaultInModuleAugmentation1.ts
@@ -0,0 +1,26 @@
+///
+
+// @Filename: /node_modules/@types/foo/index.d.ts
+////export {};
+////declare module "foo" {
+//// /*a*/export function foo(): void;/*b*/
+////}
+
+// @Filename: /b.ts
+////import { foo } from "foo";
+
+goTo.select("a", "b");
+edit.applyRefactor({
+ refactorName: "Convert export",
+ actionName: "Convert named export to default export",
+ actionDescription: "Convert named export to default export",
+ newContent: {
+ "/node_modules/@types/foo/index.d.ts":
+`export {};
+declare module "foo" {
+ export default function foo(): void;
+}`,
+ "/b.ts":
+`import foo from "foo";`
+ }
+});
diff --git a/tests/cases/fourslash/refactorConvertExport_namedToDefaultInModuleAugmentation2.ts b/tests/cases/fourslash/refactorConvertExport_namedToDefaultInModuleAugmentation2.ts
new file mode 100644
index 0000000000000..e278769f568df
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertExport_namedToDefaultInModuleAugmentation2.ts
@@ -0,0 +1,18 @@
+///
+
+////export {};
+////declare module "foo" {
+//// /*a*/export function func(): void;/*b*/
+////}
+
+goTo.select("a", "b");
+edit.applyRefactor({
+ refactorName: "Convert export",
+ actionName: "Convert named export to default export",
+ actionDescription: "Convert named export to default export",
+ newContent:
+`export {};
+declare module "foo" {
+ export default function func(): void;
+}`
+});