mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
85301803e1
PR-URL: https://github.com/nodejs/node/pull/49869 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
18 lines
433 B
JavaScript
18 lines
433 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
const buffer = fixtures.readSync('simple.wasm');
|
|
|
|
assert.ok(WebAssembly.validate(buffer), 'Buffer should be valid WebAssembly');
|
|
|
|
WebAssembly.instantiate(buffer, {}).then((results) => {
|
|
// Exported function should add two numbers.
|
|
assert.strictEqual(
|
|
results.instance.exports.add(10, 20),
|
|
30
|
|
);
|
|
});
|