Skip to content

Commit 382a273

Browse files
authored
[EH] Simplify supported node version logic (#18654)
According to https://webassembly.org/roadmap/, Wasm EH is enabled by default, i.e., not behind a flag, as of v17.0. Also I found v16 has problems even with `--experimenal-wasm-eh`. I think its implementation of `WebAssembly.Exception` JS API has changed in the meantime, and because our library_exception.js uses `WebAssembly.Exception` JS API in some cases: https://github.com/emscripten-core/emscripten/blob/0481237d73b7de6e41975d3da831ad6899d00b7c/src/library_exceptions.js#L413 This errors out with v16: ```console aheejin@aheejin:~/test/stack$ ~/apps/node-v16.9.1/node --experimental-wasm-eh ex.js /usr/local/google/home/aheejin/test/stack/ex.js:137 throw ex; ^ TypeError: WebAssembly.Exception(): Argument 0 must be an exception type with 'parameters' at ___throw_exception_with_stack_trace (/usr/local/google/home/aheejin/test/stack/ex.js:1314:15) at <anonymous>:wasm-function[1660]:0x23f98 at <anonymous>:wasm-function[13]:0x1557 at <anonymous>:wasm-function[19]:0x1884 at /usr/local/google/home/aheejin/test/stack/ex.js:895:22 at callMain (/usr/local/google/home/aheejin/test/stack/ex.js:4703:15) at doRun (/usr/local/google/home/aheejin/test/stack/ex.js:4756:23) at run (/usr/local/google/home/aheejin/test/stack/ex.js:4771:5) at runCaller (/usr/local/google/home/aheejin/test/stack/ex.js:4688:19) at removeRunDependency (/usr/local/google/home/aheejin/test/stack/ex.js:829:7) ``` I think it is the safest to just enable node after v17.
1 parent 0481237 commit 382a273

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/common.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,8 @@ def require_wasm64(self):
494494
def require_wasm_eh(self):
495495
if config.NODE_JS and config.NODE_JS in self.js_engines:
496496
version = shared.check_node_version()
497-
if version >= (16, 0, 0):
497+
if version >= (17, 0, 0):
498498
self.js_engines = [config.NODE_JS]
499-
if version < (20, 0, 0):
500-
self.node_args.append('--experimental-wasm-eh')
501499
return
502500

503501
if config.V8_ENGINE and config.V8_ENGINE in self.js_engines:

0 commit comments

Comments
 (0)