Skip to content

Commit 4a3b195

Browse files
authored
Add lib es2020.sharedmemory (microsoft#39541)
1 parent cdafb71 commit 4a3b195

File tree

6 files changed

+86
-4
lines changed

6 files changed

+86
-4
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ namespace ts {
5151
["es2019.symbol", "lib.es2019.symbol.d.ts"],
5252
["es2020.bigint", "lib.es2020.bigint.d.ts"],
5353
["es2020.promise", "lib.es2020.promise.d.ts"],
54+
["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"],
5455
["es2020.string", "lib.es2020.string.d.ts"],
5556
["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"],
5657
["es2020.intl", "lib.es2020.intl.d.ts"],

src/lib/es2020.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/// <reference lib="es2019" />
22
/// <reference lib="es2020.bigint" />
33
/// <reference lib="es2020.promise" />
4+
/// <reference lib="es2020.sharedmemory" />
45
/// <reference lib="es2020.string" />
56
/// <reference lib="es2020.symbol.wellknown" />
67
/// <reference lib="es2020.intl" />

src/lib/es2020.sharedmemory.d.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
interface Atomics {
2+
/**
3+
* Adds a value to the value at the given position in the array, returning the original value.
4+
* Until this atomic operation completes, any other read or write operation against the array
5+
* will block.
6+
*/
7+
add(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
8+
9+
/**
10+
* Stores the bitwise AND of a value with the value at the given position in the array,
11+
* returning the original value. Until this atomic operation completes, any other read or
12+
* write operation against the array will block.
13+
*/
14+
and(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
15+
16+
/**
17+
* Replaces the value at the given position in the array if the original value equals the given
18+
* expected value, returning the original value. Until this atomic operation completes, any
19+
* other read or write operation against the array will block.
20+
*/
21+
compareExchange(typedArray: BigInt64Array | BigUint64Array, index: number, expectedValue: bigint, replacementValue: bigint): bigint;
22+
23+
/**
24+
* Replaces the value at the given position in the array, returning the original value. Until
25+
* this atomic operation completes, any other read or write operation against the array will
26+
* block.
27+
*/
28+
exchange(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
29+
30+
/**
31+
* Returns the value at the given position in the array. Until this atomic operation completes,
32+
* any other read or write operation against the array will block.
33+
*/
34+
load(typedArray: BigInt64Array | BigUint64Array, index: number): bigint;
35+
36+
/**
37+
* Stores the bitwise OR of a value with the value at the given position in the array,
38+
* returning the original value. Until this atomic operation completes, any other read or write
39+
* operation against the array will block.
40+
*/
41+
or(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
42+
43+
/**
44+
* Stores a value at the given position in the array, returning the new value. Until this
45+
* atomic operation completes, any other read or write operation against the array will block.
46+
*/
47+
store(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
48+
49+
/**
50+
* Subtracts a value from the value at the given position in the array, returning the original
51+
* value. Until this atomic operation completes, any other read or write operation against the
52+
* array will block.
53+
*/
54+
sub(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
55+
56+
/**
57+
* If the value at the given position in the array is equal to the provided value, the current
58+
* agent is put to sleep causing execution to suspend until the timeout expires (returning
59+
* `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns
60+
* `"not-equal"`.
61+
*/
62+
wait(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): "ok" | "not-equal" | "timed-out";
63+
64+
/**
65+
* Wakes up sleeping agents that are waiting on the given index of the array, returning the
66+
* number of agents that were awoken.
67+
* @param typedArray A shared BigInt64Array.
68+
* @param index The position in the typedArray to wake up on.
69+
* @param count The number of sleeping agents to notify. Defaults to +Infinity.
70+
*/
71+
notify(typedArray: BigInt64Array, index: number, count?: number): number;
72+
73+
/**
74+
* Stores the bitwise XOR of a value with the value at the given position in the array,
75+
* returning the original value. Until this atomic operation completes, any other read or write
76+
* operation against the array will block.
77+
*/
78+
xor(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
79+
}

src/lib/libs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"es2019.symbol",
4343
"es2020.bigint",
4444
"es2020.promise",
45+
"es2020.sharedmemory",
4546
"es2020.string",
4647
"es2020.symbol.wellknown",
4748
"es2020.intl",

src/testRunner/unittests/config/commandLineParsing.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace ts {
8383
assertParseResult(["--lib", "es5,invalidOption", "0.ts"],
8484
{
8585
errors: [{
86-
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', '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', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
86+
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', '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', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
8787
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
8888
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
8989
file: undefined,
@@ -285,7 +285,7 @@ namespace ts {
285285
assertParseResult(["--lib", "es5,", "es7", "0.ts"],
286286
{
287287
errors: [{
288-
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', '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', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
288+
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', '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', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
289289
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
290290
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
291291
file: undefined,
@@ -304,7 +304,7 @@ namespace ts {
304304
assertParseResult(["--lib", "es5, ", "es7", "0.ts"],
305305
{
306306
errors: [{
307-
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', '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', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
307+
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', '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', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
308308
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
309309
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
310310
file: undefined,

tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Options:
2626
-t VERSION, --target VERSION Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'.
2727
-m KIND, --module KIND Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'.
2828
--lib Specify library files to be included in the compilation.
29-
'es5' 'es6' 'es2015' 'es7' 'es2016' 'es2017' 'es2018' 'es2019' 'es2020' 'esnext' 'dom' 'dom.iterable' 'webworker' 'webworker.importscripts' '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' 'es2018.intl' 'es2018.promise' 'es2018.regexp' 'es2019.array' 'es2019.object' 'es2019.string' 'es2019.symbol' 'es2020.bigint' 'es2020.promise' 'es2020.string' 'es2020.symbol.wellknown' 'es2020.intl' 'esnext.array' 'esnext.symbol' 'esnext.asynciterable' 'esnext.intl' 'esnext.bigint' 'esnext.string' 'esnext.promise'
29+
'es5' 'es6' 'es2015' 'es7' 'es2016' 'es2017' 'es2018' 'es2019' 'es2020' 'esnext' 'dom' 'dom.iterable' 'webworker' 'webworker.importscripts' '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' 'es2018.intl' 'es2018.promise' 'es2018.regexp' 'es2019.array' 'es2019.object' 'es2019.string' 'es2019.symbol' 'es2020.bigint' 'es2020.promise' 'es2020.sharedmemory' 'es2020.string' 'es2020.symbol.wellknown' 'es2020.intl' 'esnext.array' 'esnext.symbol' 'esnext.asynciterable' 'esnext.intl' 'esnext.bigint' 'esnext.string' 'esnext.promise'
3030
--allowJs Allow javascript files to be compiled.
3131
--jsx KIND Specify JSX code generation: 'preserve', 'react-native', or 'react'.
3232
-d, --declaration Generates corresponding '.d.ts' file.

0 commit comments

Comments
 (0)