Skip to content

Commit

Permalink
fix missing typeof operator in __wbg_init() template
Browse files Browse the repository at this point in the history
  • Loading branch information
bbradshaw committed Dec 19, 2023
1 parent 185e9db commit dcce0d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ impl<'a> Context<'a> {
stem = self.config.stem()?
),
OutputMode::NoModules { .. } => "\
if (typeof input === 'undefined' && script_src !== 'undefined') {
if (typeof input === 'undefined' && typeof script_src !== 'undefined') {
input = script_src.replace(/\\.js$/, '_bg.wasm');
}"
.to_string(),
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/wasm-bindgen/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ fn default_module_path_target_no_modules() {
async function __wbg_init(input) {
if (wasm !== undefined) return wasm;
if (typeof input === 'undefined' && script_src !== 'undefined') {
if (typeof input === 'undefined' && typeof script_src !== 'undefined') {
input = script_src.replace(/\\.js$/, '_bg.wasm');
}",
));
Expand Down

0 comments on commit dcce0d0

Please sign in to comment.