We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ace3e70 commit 7139325Copy full SHA for 7139325
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