aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules.js b/src/modules.js
index b31567be..18e98d76 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -275,17 +275,24 @@ var Functions = {
if (!tables[sig]) tables[sig] = emptyTable(sig); // TODO: make them compact
tables[sig][this.indexedFunctions[ident]] = ident;
}
- // Resolve multi-level aliases all the way down
var generated = false;
for (var t in tables) {
generated = true;
var table = tables[t];
for (var i = 0; i < table.length; i++) {
+ // Resolve multi-level aliases all the way down
while (1) {
var varData = Variables.globals[table[i]];
if (!(varData && varData.resolvedAlias)) break;
table[i] = table[+varData.resolvedAlias || eval(varData.resolvedAlias)]; // might need to eval to turn (6) into 6
}
+ // Resolve library aliases
+ if (table[i]) {
+ var libName = LibraryManager.getRootIdent(table[i].substr(1));
+ if (libName && typeof libName == 'string') {
+ table[i] = '_' + libName;
+ }
+ }
}
var indices = table.toString().replace('"', '');
if (BUILD_AS_SHARED_LIB) {