Skip to content

Commit

Permalink
Remove checks for deserializing wasm
Browse files Browse the repository at this point in the history
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 nodejs-ci committed Feb 6, 2020
1 parent 0860d1b commit b8c9ede
Showing 1 changed file with 11 additions and 7 deletions.
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.'
// });
}

0 comments on commit b8c9ede

Please sign in to comment.