Skip to content

Commit 652ed7f

Browse files
authored
Add lib.esnext.sharedmemory (#61646)
1 parent 51dcd90 commit 652ed7f

File tree

93 files changed

+1049
-753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1049
-753
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ const libEntries: [string, string][] = [
249249
["esnext.promise", "lib.esnext.promise.d.ts"],
250250
["esnext.float16", "lib.esnext.float16.d.ts"],
251251
["esnext.error", "lib.esnext.error.d.ts"],
252+
["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"],
252253
["decorators", "lib.decorators.d.ts"],
253254
["decorators.legacy", "lib.decorators.legacy.d.ts"],
254255
];

src/compiler/utilities.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,9 @@ export const getScriptTargetFeatures: () => ScriptTargetFeatures = /* @__PURE__
14521452
es2024: [
14531453
"waitAsync",
14541454
],
1455+
esnext: [
1456+
"pause",
1457+
],
14551458
})),
14561459
SharedArrayBuffer: new Map(Object.entries({
14571460
es2017: [

src/lib/esnext.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/// <reference lib="esnext.promise" />
99
/// <reference lib="esnext.float16" />
1010
/// <reference lib="esnext.error" />
11+
/// <reference lib="esnext.sharedmemory" />

src/lib/esnext.sharedmemory.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface Atomics {
2+
/**
3+
* Performs a finite-time microwait by signaling to the operating system or
4+
* CPU that the current executing code is in a spin-wait loop.
5+
*/
6+
pause(n?: number): void;
7+
}

src/lib/libs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"esnext.promise",
8989
"esnext.float16",
9090
"esnext.error",
91+
"esnext.sharedmemory",
9192
"decorators",
9293
"decorators.legacy",
9394
// Default libraries

tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).trace.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,19 @@
10451045
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
10461046
"Directory '/node_modules' does not exist, skipping all lookups in it.",
10471047
"======== Module name '@typescript/lib-esnext/error' was not resolved. ========",
1048+
"======== Resolving module '@typescript/lib-esnext/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.esnext.sharedmemory.d.ts__.ts'. ========",
1049+
"Explicitly specified module resolution kind: 'Node10'.",
1050+
"Loading module '@typescript/lib-esnext/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.",
1051+
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
1052+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
1053+
"Scoped package detected, looking in 'typescript__lib-esnext/sharedmemory'",
1054+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
1055+
"Scoped package detected, looking in 'typescript__lib-esnext/sharedmemory'",
1056+
"Loading module '@typescript/lib-esnext/sharedmemory' from 'node_modules' folder, target file types: JavaScript.",
1057+
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
1058+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
1059+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
1060+
"======== Module name '@typescript/lib-esnext/sharedmemory' was not resolved. ========",
10481061
"======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========",
10491062
"Explicitly specified module resolution kind: 'Node10'.",
10501063
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.",

tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,21 @@
12091209
"======== Module name '@typescript/lib-esnext/error' was not resolved. ========",
12101210
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
12111211
"File '/package.json' does not exist according to earlier cached lookups.",
1212+
"======== Resolving module '@typescript/lib-esnext/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.esnext.sharedmemory.d.ts__.ts'. ========",
1213+
"Explicitly specified module resolution kind: 'Node10'.",
1214+
"Loading module '@typescript/lib-esnext/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.",
1215+
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
1216+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
1217+
"Scoped package detected, looking in 'typescript__lib-esnext/sharedmemory'",
1218+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
1219+
"Scoped package detected, looking in 'typescript__lib-esnext/sharedmemory'",
1220+
"Loading module '@typescript/lib-esnext/sharedmemory' from 'node_modules' folder, target file types: JavaScript.",
1221+
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
1222+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
1223+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
1224+
"======== Module name '@typescript/lib-esnext/sharedmemory' was not resolved. ========",
1225+
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
1226+
"File '/package.json' does not exist according to earlier cached lookups.",
12121227
"======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========",
12131228
"Explicitly specified module resolution kind: 'Node10'.",
12141229
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.",

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ CompilerOptions::
3030
"configFilePath": "/apath/tsconfig.json"
3131
}
3232
Errors::
33-
error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.error', 'decorators', 'decorators.legacy'.
33+
error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'.
3434

0 commit comments

Comments
 (0)