Skip to content

Commit

Permalink
Throw error if target = web and there is a exported symbol called "de…
Browse files Browse the repository at this point in the history
…fault"
  • Loading branch information
Nicklas Warming Jacobsen committed Apr 22, 2024
1 parent b1d9bd4 commit 7dbc7f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/cli-support/src/lib.rs
Expand Up @@ -327,6 +327,13 @@ impl Bindgen {
.context("failed getting Wasm module")?,
};

// Check that no exported symbol is called "default" if we target web.
if matches!(self.mode, OutputMode::Web)
&& module.exports.iter().any(|export| export.name == "default")
{
bail!("exported symbol \"default\" not allowed for --target web")
}

let thread_count = self
.threads
.run(&mut module)
Expand Down

0 comments on commit 7dbc7f7

Please sign in to comment.