summaryrefslogtreecommitdiff
path: root/core/examples/wasm.js
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-07-01 18:00:14 -0600
committerGitHub <noreply@github.com>2023-07-02 00:00:14 +0000
commite746b6d80654ba4e4e26370fe6e4f784ce841d92 (patch)
tree153ffad92a96126b9ab8e906dcdabf7648755931 /core/examples/wasm.js
parentb9c0e7cd550ab14fa7da7e33ed87cbeeeb9785a0 (diff)
refactor(core): Extract deno_core (#19658)
`deno_core` is moving out! You'll find it at https://github.com/denoland/deno_core/ once this PR lands.
Diffstat (limited to 'core/examples/wasm.js')
-rw-r--r--core/examples/wasm.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/core/examples/wasm.js b/core/examples/wasm.js
deleted file mode 100644
index cb6a4af52..000000000
--- a/core/examples/wasm.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-
-// asc wasm.ts --exportStart --initialMemory 6400 -O -o wasm.wasm
-// deno-fmt-ignore
-const bytes = new Uint8Array([
- 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 2,
- 15, 1, 3, 111, 112, 115, 7, 111, 112, 95, 119, 97, 115, 109, 0,
- 0, 3, 3, 2, 0, 0, 5, 4, 1, 0, 128, 50, 7, 36, 4,
- 7, 111, 112, 95, 119, 97, 115, 109, 0, 0, 4, 99, 97, 108, 108,
- 0, 1, 6, 109, 101, 109, 111, 114, 121, 2, 0, 6, 95, 115, 116,
- 97, 114, 116, 0, 2, 10, 10, 2, 4, 0, 16, 0, 11, 3, 0,
- 1, 11
- ]);
-
-const { ops } = Deno.core;
-
-const module = new WebAssembly.Module(bytes);
-const instance = new WebAssembly.Instance(module, { ops });
-ops.op_set_wasm_mem(instance.exports.memory);
-
-instance.exports.call();
-
-const memory = instance.exports.memory;
-const view = new Uint8Array(memory.buffer);
-
-if (view[0] !== 69) {
- throw new Error("Expected first byte to be 69");
-}