| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 65e5a8a commit 8f5ffff
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -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 | + assert.throws( | ||
| 27 | + () => { wasi.start(instance); }, | ||
| 28 | + { code: 'ERR_INVALID_ARG_TYPE', message: /\bWebAssembly\.Memory\b/ } | ||
| 29 | + ); | ||
| 30 | + })(); | ||
| 31 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments