Skip to content

Commit

Permalink
embind - Remove node exception handling flag for node 17+.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandahl committed Feb 23, 2024
1 parent f302d4c commit 6f1d0c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@ def run_embind_gen(wasm_target, js_syms, extra_settings):
if settings.MEMORY64:
node_args += shared.node_memory64_flags()
if settings.WASM_EXCEPTIONS:
node_args += shared.node_exception_flags()
node_args += shared.node_exception_flags(config.NODE_JS)
# Run the generated JS file with the proper flags to generate the TypeScript bindings.
out = shared.run_js_tool(outfile_js, [], node_args, stdout=PIPE)
settings.restore(original_settings)
Expand Down
9 changes: 7 additions & 2 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,13 @@ def node_memory64_flags():
return ['--experimental-wasm-memory64']


def node_exception_flags():
return ['--experimental-wasm-eh']
def node_exception_flags(nodejs):
node_version = get_node_version(nodejs)
# Exception handling was enabled by default in node v17.
if node_version and node_version < (17, 0, 0):
return ['--experimental-wasm-eh']
else:
return []


def node_pthread_flags(nodejs):
Expand Down

0 comments on commit 6f1d0c1

Please sign in to comment.