node/test/wasi
Ben Noordhuis 9ad8b4d393 wasi: relax WebAssembly.Instance type check
Instances coming from different VM contexts don't pass `instanceof`
type checks because each context has its own copy of the built-in
globals.

After review of the relevant code it seems like it should be safe to
relax the type check and that is what this commit does: `wasi.start()`
now accepts any input that walks and quacks like a WebAssembly.Instance
or WebAssembly.Memory instance.

Fixes: https://github.com/nodejs/node/issues/33415

PR-URL: https://github.com/nodejs/node/pull/33431
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-23 17:57:11 +02:00
..
c test: add WASI test for path_link() 2020-03-08 15:11:46 -04:00
wasm test: add WASI test for path_link() 2020-03-08 15:11:46 -04:00
Makefile
README.md
test-return-on-exit.js test: verify that WASI errors are rethrown 2020-03-13 18:18:15 -04:00
test-wasi-not-started.js wasi: prevent syscalls before start 2020-05-08 01:02:19 +02:00
test-wasi-options-validation.js wasi: add returnOnExit option 2020-03-08 11:05:23 -04:00
test-wasi-require-flag.js wasi: require CLI flag to require() wasi module 2019-12-17 06:02:04 +01:00
test-wasi-start-validation.js wasi: relax WebAssembly.Instance type check 2020-05-23 17:57:11 +02:00
test-wasi-symlinks.js test: add wasi test for symlink() and readlink() 2020-01-20 11:02:47 -05:00
test-wasi.js test: skip a wasi test on IBMi PASE 2020-03-30 17:08:43 +02:00
testcfg.py
wasi.status

WASI Tests

Compile with clang and wasm32-wasi target. The clang version used must be built with wasi-libc. You can specify the location for clang and the sysroot if needed when running make:

$ make CC=/usr/local/opt/llvm/bin/clang SYSROOT=/path/to/wasi-libc/sysroot