Skip to content
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

__wbindgen_thread_destroy has optional params #3703

Merged
Merged
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions crates/cli-support/src/wasm2es6js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ fn push_index_identifier(i: usize, s: &mut String) {
}
}

fn args_are_optional(name: &str) -> bool {
name == "__wbindgen_thread_destroy"
}

pub fn interface(module: &Module) -> Result<String, Error> {
let mut exports = String::new();

Expand All @@ -81,6 +85,9 @@ pub fn interface(module: &Module) -> Result<String, Error> {
}

push_index_identifier(i, &mut args);
if args_are_optional(&entry.name) {
args.push('?');
}
args.push_str(": number");
}

Expand Down