diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-10 14:07:02 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-10 14:07:02 -0800 |
commit | 21bb26dbc4bc4e897b2f44d38b21a3124b5d267b (patch) | |
tree | d0ac032156d75067cc40d8a842f39e086fc29624 /src/modules.js | |
parent | 60c6395d05545c8fd8ad277b026d79fe4ffdbd38 (diff) |
call library aliases directly by their target name
Diffstat (limited to 'src/modules.js')
-rw-r--r-- | src/modules.js | 9 |
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) { |