summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-04-17 10:34:16 -0700
committerGitHub <noreply@github.com>2019-04-17 10:34:16 -0700
commit4a1a935ff0e30c9e46f4b7469488a5b6ffee2714 (patch)
treed0c36f4e36d9cb75c70e8d42b86b42e93e81c4fc /src
parentdb6d6dc9049bf01423202a445e57450ae230e7c2 (diff)
downloadbinaryen-4a1a935ff0e30c9e46f4b7469488a5b6ffee2714.tar.gz
binaryen-4a1a935ff0e30c9e46f4b7469488a5b6ffee2714.tar.bz2
binaryen-4a1a935ff0e30c9e46f4b7469488a5b6ffee2714.zip
Demote a wasm2js warning on scopes (#2016)
We do not actually analyze scopes properly there, see comment in the commit. For now, just demote it to a warning. Not sure if it's worth fixing it or just removing it.
Diffstat (limited to 'src')
-rw-r--r--src/wasm2js.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h
index ac325ce13..3c868e8dd 100644
--- a/src/wasm2js.h
+++ b/src/wasm2js.h
@@ -230,9 +230,13 @@ public:
// it's a bug currently if they're not globally unique. This should
// probably be fixed via a different namespace for exports or something
// like that.
+ // XXX This is not actually a valid check atm, since functions are not in the
+ // global-most scope, but rather in the "asmFunc" scope which is inside it.
+ // Also, for emscripten style glue, we emit the exports as a return, so there
+ // is no name placed into the scope. For these reasons, just warn here, don't
+ // error.
if (scope == NameScope::Top) {
- Fatal() << "global scope is colliding with other scope: " << mangled << '\n';
- abort();
+ std::cerr << "wasm2js: warning: global scope may be colliding with other scope: " << mangled << '\n';
}
}
allMangledNames.insert(ret);