fix corner case in ie (#5652)

fixes #5651
This commit is contained in:
Alex Lam S.L
2022-09-08 03:49:40 +01:00
committed by GitHub
parent 4e4a2f8ed3
commit 5b5f6e329c
3 changed files with 53 additions and 2 deletions

View File

@@ -369,8 +369,9 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
// pass 3: fix up any scoping issue with IE8
if (options.ie) self.walk(new TreeWalker(function(node) {
if (node instanceof AST_SymbolCatch) {
var scope = node.thedef.defun;
if (scope.name instanceof AST_SymbolLambda && scope.name.name == node.name) {
var def = node.thedef;
var scope = def.defun;
if (def.name != "arguments" && scope.name instanceof AST_SymbolLambda && scope.name.name == def.name) {
scope = scope.parent_scope.resolve();
}
redefine(node, scope);