diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-31 14:37:13 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-31 14:37:13 -0800 |
commit | f7e8ad550d061bda93884a161a0f923f9c3e83e7 (patch) | |
tree | 6ba176fabca40ee52e91604475f488995dfc6ff2 | |
parent | 491dcb14416c292c4c5e35d98c8bfd9c669ec190 (diff) |
properly forward unnamed global externals to asm
-rw-r--r-- | src/jsifier.js | 4 |
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, |