summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-04-26 23:54:07 +0800
committerGitHub <noreply@github.com>2021-04-26 17:54:07 +0200
commite4e7d957e8cde899d48878c83f2099b0028dfdef (patch)
tree23e0503921c4749aab4a0ba08ddaec6b7756f4ba /cli
parent791513d608279796a6a1fd963ea1d5b012699baa (diff)
feat(core): enable wasm threading support (#10116)
Diffstat (limited to 'cli')
-rw-r--r--cli/dts/lib.deno.shared_globals.d.ts3
-rw-r--r--cli/tests/integration_tests.rs5
-rw-r--r--cli/tests/wasm_shared.out0
-rw-r--r--cli/tests/wasm_shared.ts6
4 files changed, 13 insertions, 1 deletions
diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts
index e3fd2bf60..a2609be85 100644
--- a/cli/dts/lib.deno.shared_globals.d.ts
+++ b/cli/dts/lib.deno.shared_globals.d.ts
@@ -89,7 +89,7 @@ declare namespace WebAssembly {
constructor(descriptor: MemoryDescriptor);
/** An accessor property that returns the buffer contained in the memory. */
- readonly buffer: ArrayBuffer;
+ readonly buffer: ArrayBuffer | SharedArrayBuffer;
/**
* Increases the size of the memory instance by a specified number of WebAssembly
@@ -170,6 +170,7 @@ declare namespace WebAssembly {
export interface MemoryDescriptor {
initial: number;
maximum?: number;
+ shared?: boolean;
}
/** A `ModuleExportDescriptor` is the description of a declared export in a `WebAssembly.Module`. */
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 50c70213a..92deb9416 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -3446,6 +3446,11 @@ console.log("finish");
output: "wasm.ts.out",
});
+ itest!(wasm_shared {
+ args: "run --quiet wasm_shared.ts",
+ output: "wasm_shared.out",
+ });
+
itest!(wasm_async {
args: "run wasm_async.js",
output: "wasm_async.out",
diff --git a/cli/tests/wasm_shared.out b/cli/tests/wasm_shared.out
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/cli/tests/wasm_shared.out
diff --git a/cli/tests/wasm_shared.ts b/cli/tests/wasm_shared.ts
new file mode 100644
index 000000000..b713385d5
--- /dev/null
+++ b/cli/tests/wasm_shared.ts
@@ -0,0 +1,6 @@
+const memory = new WebAssembly.Memory({
+ initial: 1,
+ maximum: 10,
+ shared: true,
+});
+console.assert(memory.buffer instanceof SharedArrayBuffer);