mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-31 17:31:06 +00:00
panic when modules used
This commit is contained in:
parent
8c935d5d94
commit
aa6487b6f1
@ -1622,6 +1622,10 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
|||||||
|
|
||||||
fn import_name(&mut self, import: &shared::Import, item: &str) -> String {
|
fn import_name(&mut self, import: &shared::Import, item: &str) -> String {
|
||||||
if let Some(ref module) = import.module {
|
if let Some(ref module) = import.module {
|
||||||
|
if self.cx.config.no_modules {
|
||||||
|
panic!("import from `{}` module not allowed in `--no-modules`. use `--nodejs` or `--browser` instead", module);
|
||||||
|
}
|
||||||
|
|
||||||
let name = import.js_namespace.as_ref().map(|s| &**s).unwrap_or(item);
|
let name = import.js_namespace.as_ref().map(|s| &**s).unwrap_or(item);
|
||||||
|
|
||||||
if self.cx.imported_names.insert(name.to_string()) {
|
if self.cx.imported_names.insert(name.to_string()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user