aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-31 14:37:13 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-31 14:37:13 -0800
commitf7e8ad550d061bda93884a161a0f923f9c3e83e7 (patch)
tree6ba176fabca40ee52e91604475f488995dfc6ff2
parent491dcb14416c292c4c5e35d98c8bfd9c669ec190 (diff)
properly forward unnamed global externals to asm
-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,