diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 8e30530b..b31f406a 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -465,10 +465,12 @@ impl<'a> Context<'a> { }; let default_module_path = match self.config.mode { - OutputMode::Web => "\ + OutputMode::Web => { + "\ if (typeof module === 'undefined') { module = import.meta.url.replace(/\\.js$/, '_bg.wasm'); - }", + }" + } _ => "", }; diff --git a/crates/cli/tests/wasm-bindgen/main.rs b/crates/cli/tests/wasm-bindgen/main.rs index 2f58e2fe..568940d7 100644 --- a/crates/cli/tests/wasm-bindgen/main.rs +++ b/crates/cli/tests/wasm-bindgen/main.rs @@ -206,7 +206,7 @@ fn empty_interface_types() { r#" #[no_mangle] pub extern fn foo() {} - "# + "#, ) .file( "Cargo.toml", diff --git a/crates/futures/src/task/multithread.rs b/crates/futures/src/task/multithread.rs index 70f28cf4..f2fed544 100644 --- a/crates/futures/src/task/multithread.rs +++ b/crates/futures/src/task/multithread.rs @@ -130,7 +130,7 @@ impl Task { // resources associated with the future ASAP. Poll::Ready(()) => { *borrow = None; - }, + } // Unlike `singlethread.rs` we are responsible for ensuring there's // a closure to handle the notification that a Future is ready. In diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 4fb52c99..7394cb90 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -568,7 +568,7 @@ impl<'src> FirstPassRecord<'src> { // whitelist a few names that have known polyfills match name { - "AudioContext" => { + "AudioContext" | "OfflineAudioContext" => { import_type .vendor_prefixes .push(Ident::new("webkit", Span::call_site()));