diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 1aaf0c2f..e5602ed9 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -191,15 +191,11 @@ impl<'a> Context<'a> { // `__wbindgen_malloc`) if none of our JS glue actually needed it. self.unexport_unused_internal_exports(); - // Handle the `start` function, if one was specified. If we're in a - // --test mode (such as wasm-bindgen-test-runner) then we skip this - // entirely. Otherwise we want to first add a start function to the - // `start` section if one is specified. - // - // Note that once a start function is added, if any, we immediately - // un-start it. This is done because we require that the JS glue - // initializes first, so we execute wasm startup manually once the JS - // glue is all in place. + // Initialization is just flat out tricky and not something we + // understand super well. To try to handle various issues that have come + // up we always remove the `start` function if one is present. The JS + // bindings glue then manually calls the start function (if it was + // previously present). let mut needs_manual_start = false; if self.config.emit_start { needs_manual_start = self.unstart_start_function(); diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs index 1c65c484..16ddca9c 100755 --- a/crates/cli-support/src/lib.rs +++ b/crates/cli-support/src/lib.rs @@ -317,6 +317,11 @@ impl Bindgen { // supports that aren't covered by WebIDL bindings. webidl::process(&mut module)?; + // Now that we've got type information from the webidl processing pass, + // touch up the output of rustc to insert anyref shims where necessary. + // This is only done if the anyref pass is enabled, which it's + // currently off-by-default since `anyref` is still in development in + // engines. if self.anyref { anyref::process(&mut module)?; }