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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
* Add additional constructor to `DataView` for `SharedArrayBuffer`.
[#3695](https://github.com/rustwasm/wasm-bindgen/pull/3695)

* Stabilize `wasm_bindgen::module()`.
[#3690](https://github.com/rustwasm/wasm-bindgen/pull/3690)

### Fixed

* The DWARF section is now correctly modified instead of leaving it in a broken state.
[#3483](https://github.com/rustwasm/wasm-bindgen/pull/3483)

* Update the TypeScript signature of `__wbindgen_thread_destroy` to indicate that it's parameters are optional.
[#3703](https://github.com/rustwasm/wasm-bindgen/pull/3703)

## [0.2.88](https://github.com/rustwasm/wasm-bindgen/compare/0.2.87...0.2.88)

Released 2023-11-01
Expand Down
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