diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-27 13:20:17 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-27 13:20:17 -0800 |
commit | 8e708a251fe5c62e1f36fcfb15d44705d17efa93 (patch) | |
tree | 2463ed8dd3f0249297bf288dc15d26479dd7668d | |
parent | ed7d230d8d8dc2c25a3dd28080d971deaa061d6d (diff) |
do not globalIndex externals
-rw-r--r-- | src/jsifier.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 816290f8..9c180652 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -265,10 +265,6 @@ function JSify(data, functionsOnly, givenFunctions) { var constant = null; var allocator = (BUILD_AS_SHARED_LIB && !item.external) ? 'ALLOC_NORMAL' : 'ALLOC_STATIC'; var index = null; - if (!NAMED_GLOBALS) { - index = makeGlobalUse(item.ident); - allocator = 'ALLOC_NONE'; - } if (item.external && BUILD_AS_SHARED_LIB) { // External variables in shared libraries should not be declared as // they would shadow similarly-named globals in the parent. @@ -302,6 +298,10 @@ function JSify(data, functionsOnly, givenFunctions) { } return ret; } else { + if (!NAMED_GLOBALS) { + index = makeGlobalUse(item.ident); + allocator = 'ALLOC_NONE'; + } constant = parseConst(item.value, item.type, item.ident); if (typeof constant === 'string' && constant[0] != '[') { constant = [constant]; // A single item. We may need a postset for it. |