| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f6e341a commit 7f78137
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -283,6 +283,7 @@ DeserializerContext::DeserializerContext(Environment* env, | |||
| 283 | 283 | length_(Buffer::Length(buffer)), | |
| 284 | 284 | deserializer_(env->isolate(), data_, length_, this) { | |
| 285 | 285 | object()->Set(env->context(), env->buffer_string(), buffer).FromJust(); | |
| 286 | + deserializer_.SetExpectInlineWasm(true); | ||
| 286 | 287 | ||
| 287 | 288 | MakeWeak(); | |
| 288 | 289 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,13 +4,16 @@ | |||
| 4 | 4 | ||
| 5 | 5 | const { internalBinding } = require('internal/test/binding'); | |
| 6 | 6 | const common = require('../common'); | |
| 7 | + const fixtures = require('../common/fixtures'); | ||
| 7 | 8 | const assert = require('assert'); | |
| 8 | 9 | const v8 = require('v8'); | |
| 9 | 10 | const os = require('os'); | |
| 10 | 11 | ||
| 11 | 12 | const circular = {}; | |
| 12 | 13 | circular.circular = circular; | |
| 13 | 14 | ||
| 15 | + const wasmModule = new WebAssembly.Module(fixtures.readSync('test.wasm')); | ||
| 16 | + | ||
| 14 | 17 | const objects = [ | |
| 15 | 18 | { foo: 'bar' }, | |
| 16 | 19 | { bar: 'baz' }, | |
@@ -20,7 +23,8 @@ const objects = [ | |||
| 20 | 23 | undefined, | |
| 21 | 24 | null, | |
| 22 | 25 | 42, | |
| 23 | - circular | ||
| 26 | + circular, | ||
| 27 | + wasmModule | ||
| 24 | 28 | ]; | |
| 25 | 29 | ||
| 26 | 30 | const hostObject = new (internalBinding('js_stream').JSStream)(); | |
@@ -230,3 +234,9 @@ const deserializerTypeError = | |||
| 230 | 234 | /^TypeError: buffer must be a TypedArray or a DataView$/, | |
| 231 | 235 | ); | |
| 232 | 236 | } | |
| 237 | + | ||
| 238 | + { | ||
| 239 | + const deserializedWasmModule = v8.deserialize(v8.serialize(wasmModule)); | ||
| 240 | + const instance = new WebAssembly.Instance(deserializedWasmModule); | ||
| 241 | + assert.strictEqual(instance.exports.addTwo(10, 20), 30); | ||
| 242 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments