Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove checks for deserializing wasm
Serialization support of WasmModuleObjects will be removed in
https://crrev.com/c/2013110, thus we need to stop testing for that.
  • Loading branch information
backes authored and mmarchini committed Mar 4, 2020
commit 6ae70047f79f566fa274ffe51b727f5d3873c142
18 changes: 11 additions & 7 deletions test/parallel/test-v8-serdes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'use strict';

const common = require('../common');
const fixtures = require('../common/fixtures');
// const fixtures = require('../common/fixtures');
const { internalBinding } = require('internal/test/binding');
const assert = require('assert');
const v8 = require('v8');
Expand All @@ -12,7 +12,7 @@ const os = require('os');
const circular = {};
circular.circular = circular;

const wasmModule = new WebAssembly.Module(fixtures.readSync('simple.wasm'));
// const wasmModule = new WebAssembly.Module(fixtures.readSync('simple.wasm'));

const objects = [
{ foo: 'bar' },
Expand All @@ -23,8 +23,7 @@ const objects = [
undefined,
null,
42,
circular,
wasmModule
circular
];

const hostObject = new (internalBinding('js_stream').JSStream)();
Expand Down Expand Up @@ -238,7 +237,12 @@ const deserializerTypeError =
}

{
const deserializedWasmModule = v8.deserialize(v8.serialize(wasmModule));
const instance = new WebAssembly.Instance(deserializedWasmModule);
assert.strictEqual(instance.exports.add(10, 20), 30);
// V8 is removing support for serializing wasm modules via the value
// serializer. Once this is complete (https://crrev.com/c/2013110), we can
// re-add this test:
// assert.throws(
// () => v8.serialize(wasmModule), {
// constructor: Error,
// message: '#<Module> could not be cloned.'
// });
}