aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/jsifier.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 5499910a..5a16e484 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -355,6 +355,10 @@ function JSify(data, functionsOnly, givenFunctions) {
// TODO: make the assert conditional on ASSERTIONS
js += 'if (globalScope) { assert(!globalScope["' + item.ident + '"]); globalScope["' + item.ident + '"] = ' + item.ident + ' }';
}
+ if (item.external && !NAMED_GLOBALS) {
+ assert(ASM_JS);
+ js = 'var ' + item.ident + ' = ' + js; // force an explicit naming, even if unnamed globals, for asm forwarding
+ }
return ret.concat({
intertype: 'GlobalVariable',
JS: js,