Skip to content

[embind] Remove node exception handling flag for node 17+. #21411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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