aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/jsifier.js8
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.