Skip to content

Commit c22b907

Browse files
committed
Touch up some comments
1 parent ee426c0 commit c22b907

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

crates/cli-support/src/js/mod.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,11 @@ impl<'a> Context<'a> {
191191
// `__wbindgen_malloc`) if none of our JS glue actually needed it.
192192
self.unexport_unused_internal_exports();
193193

194-
// Handle the `start` function, if one was specified. If we're in a
195-
// --test mode (such as wasm-bindgen-test-runner) then we skip this
196-
// entirely. Otherwise we want to first add a start function to the
197-
// `start` section if one is specified.
198-
//
199-
// Note that once a start function is added, if any, we immediately
200-
// un-start it. This is done because we require that the JS glue
201-
// initializes first, so we execute wasm startup manually once the JS
202-
// glue is all in place.
194+
// Initialization is just flat out tricky and not something we
195+
// understand super well. To try to handle various issues that have come
196+
// up we always remove the `start` function if one is present. The JS
197+
// bindings glue then manually calls the start function (if it was
198+
// previously present).
203199
let mut needs_manual_start = false;
204200
if self.config.emit_start {
205201
needs_manual_start = self.unstart_start_function();

crates/cli-support/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ impl Bindgen {
317317
// supports that aren't covered by WebIDL bindings.
318318
webidl::process(&mut module)?;
319319

320+
// Now that we've got type information from the webidl processing pass,
321+
// touch up the output of rustc to insert anyref shims where necessary.
322+
// This is only done if the anyref pass is enabled, which it's
323+
// currently off-by-default since `anyref` is still in development in
324+
// engines.
320325
if self.anyref {
321326
anyref::process(&mut module)?;
322327
}

0 commit comments

Comments
 (0)