aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parseTools.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 5770a0d7..64fd0f91 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -357,12 +357,12 @@ function hasVarArgs(params) {
}
function makeGlobalDef(ident) {
- if (!NAMED_GLOBALS) return '';
+ if (!NAMED_GLOBALS && !Variables.globals[ident].alias) return '';
return 'var ' + ident + ';'; // TODO: add option for namespacing or offsetting to allow reducing the number of globals
}
function makeGlobalUse(ident) {
- if (!NAMED_GLOBALS) {
+ if (!NAMED_GLOBALS && !Variables.globals[ident].alias) {
if (!(ident in Variables.indexedGlobals)) {
Variables.indexedGlobals[ident] = Variables.nextIndexedOffset;
Variables.nextIndexedOffset += Runtime.alignMemory(calcAllocatedSize(Variables.globals[ident].type));