8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
There was an error whil 8000 e loading. Please reload this page.
1 parent 65e5a8a commit 8f5ffffCopy full SHA for 8f5ffff
test/wasi/test-wasi-start-validation.js
@@ -0,0 +1,31 @@
1
+'use strict';
2
+
3
+require('../common');
4
+const assert = require('assert');
5
+const { WASI } = require('wasi');
6
7
+const fixtures = require('../common/fixtures');
8
9
+{
10
+ const wasi = new WASI();
11
+ assert.throws(
12
+ () => {
13
+ wasi.start();
14
+ },
15
+ { code: 'ERR_INVALID_ARG_TYPE', message: /\bWebAssembly\.Instance\b/ }
16
+ );
17
+}
18
19
20
+ const wasi = new WASI({});
21
+ (async () => {
22
+ const bufferSource = fixtures.readSync('simple.wasm');
23
+ const wasm = await WebAssembly.compile(bufferSource);
24
+ const instance = await WebAssembly.instantiate(wasm);
25
26
27
+ () => { wasi.start(instance); },
28
+ { code: 'ERR_INVALID_ARG_TYPE', message: /\bWebAssembly\.Memory\b/ }
29
30
+ })();
31
0 commit comments