Skip to content

Commit

Permalink
__wbindgen_thread_destroy has optional params (#3703)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexErrant authored Nov 15, 2023
1 parent 9fb3bca commit fe88e39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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

0 comments on commit fe88e39

Please sign in to comment.