workaround firefox asm.js quirks (#3650)

fixes #3636
This commit is contained in:
Alex Lam S.L
2019-12-28 23:14:53 +00:00
committed by GitHub
parent d9cd3d33c8
commit d1a78920d9
2 changed files with 71 additions and 0 deletions

View File

@@ -428,6 +428,11 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) {
if (options.cache && node instanceof AST_Toplevel) {
node.globals.each(mangle);
}
if (node instanceof AST_Defun && tw.has_directive("use asm")) {
var sym = new AST_SymbolRef(node.name);
sym.scope = node;
sym.reference(options);
}
node.variables.each(function(def) {
if (!defer_redef(def)) mangle(def);
});