mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 15:30:56 +01:00
decc5f5506
PR-URL: https://github.com/nodejs/node/pull/30919 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
32 lines
697 B
JavaScript
32 lines
697 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { WASI } = require('wasi');
|
|
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
{
|
|
const wasi = new WASI();
|
|
assert.throws(
|
|
() => {
|
|
wasi.start();
|
|
},
|
|
{ code: 'ERR_INVALID_ARG_TYPE', message: /\bWebAssembly\.Instance\b/ }
|
|
);
|
|
}
|
|
|
|
{
|
|
const wasi = new WASI({});
|
|
(async () => {
|
|
const bufferSource = fixtures.readSync('simple.wasm');
|
|
const wasm = await WebAssembly.compile(bufferSource);
|
|
const instance = await WebAssembly.instantiate(wasm);
|
|
|
|
assert.throws(
|
|
() => { wasi.start(instance); },
|
|
{ code: 'ERR_INVALID_ARG_TYPE', message: /\bWebAssembly\.Memory\b/ }
|
|
);
|
|
})();
|
|
}
|