| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + ;; Compiled using the WebAssembly Tootkit (https://github.com/WebAssembly/wabt) | ||
| 2 | + ;; $ wat2wasm --enable-threads shared-memory.wat -o shared-memory.wasm | ||
| 3 | + | ||
| 4 | + (module | ||
| 5 | + ;; Create shared memory with initial 1 page (64KiB) and max 1 page | ||
| 6 | + (memory $mem 1 1 shared) | ||
| 7 | + (export "memory" (memory $mem)) | ||
| 8 | + ) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + ;; Compiled using the WebAssembly Tootkit (https://github.com/WebAssembly/wabt) | ||
| 2 | + ;; $ wat2wasm simple.wat -o simple.wasm | ||
| 3 | + | ||
| 4 | + (module | ||
| 5 | + (func $add (param $a i32) (param $b i32) (result i32) | ||
| 6 | + ;; return $a + $b | ||
| 7 | + (i32.add (get_local $a) (get_local $b)) | ||
| 8 | + ) | ||
| 9 | + | ||
| 10 | + (export "add" (func $add)) | ||
| 11 | + ) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); | |||
| 9 | 9 | const { JSStream } = internalBinding('js_stream'); | |
| 10 | 10 | ||
| 11 | 11 | const external = (new JSStream())._externalStream; | |
| 12 | - const wasmBuffer = fixtures.readSync('test.wasm'); | ||
| 12 | + const wasmBuffer = fixtures.readSync('simple.wasm'); | ||
| 13 | 13 | ||
| 14 | 14 | for (const [ value, _method ] of [ | |
| 15 | 15 | [ external, 'isExternal' ], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ const os = require('os'); | |||
| 12 | 12 | const circular = {}; | |
| 13 | 13 | circular.circular = circular; | |
| 14 | 14 | ||
| 15 | - const wasmModule = new WebAssembly.Module(fixtures.readSync('test.wasm')); | ||
| 15 | + const wasmModule = new WebAssembly.Module(fixtures.readSync('simple.wasm')); | ||
| 16 | 16 | ||
| 17 | 17 | const objects = [ | |
| 18 | 18 | { foo: 'bar' }, | |
@@ -238,5 +238,5 @@ const deserializerTypeError = | |||
| 238 | 238 | { | |
| 239 | 239 | const deserializedWasmModule = v8.deserialize(v8.serialize(wasmModule)); | |
| 240 | 240 | const instance = new WebAssembly.Instance(deserializedWasmModule); | |
| 241 | - assert.strictEqual(instance.exports.addTwo(10, 20), 30); | ||
| 241 | + assert.strictEqual(instance.exports.add(10, 20), 30); | ||
| 242 | 242 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments