fix corner case in ie8 & rename (#3474)

fixes #3473
This commit is contained in:
Alex Lam S.L
2019-10-15 07:27:02 +08:00
committed by GitHub
parent 736019b767
commit d3d1d11926
6 changed files with 118 additions and 5 deletions

View File

@@ -192,7 +192,11 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
// pass 3: fix up any scoping issue with IE8
if (options.ie8) self.walk(new TreeWalker(function(node) {
if (node instanceof AST_SymbolCatch) {
redefine(node, node.thedef.defun);
var scope = node.thedef.defun;
if (scope.name instanceof AST_SymbolLambda && scope.name.name == node.name) {
scope = scope.parent_scope;
}
redefine(node, scope);
return true;
}
if (node instanceof AST_SymbolLambda) {