Skip to content

Commit

Permalink
Fix JS shim default path detection for the no-modules target (#3748)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbradshaw committed Dec 20, 2023
1 parent 185e9db commit cc9a219
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

## [Unreleased](https://github.com/rustwasm/wasm-bindgen/compare/0.2.89...main)

### Fixed

* Fix JS shim default path detection for the no-modules target.
[#3748](https://github.com/rustwasm/wasm-bindgen/pull/3748)

### Added

* Add bindings for `RTCRtpSender.getCapabilities(DOMString)` method, `RTCRtpCapabilities`, `RTCRtpCodecCapability` and `RTCRtpHeaderExtensionCapability`.
Expand Down
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 cc9a219

Please sign in to comment.