aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-15 07:27:02 +0800
committerGitHub <noreply@github.com>2019-10-15 07:27:02 +0800
commitd3d1d11926de43fc1ec74ae3a4d24a884d80d91f (patch)
tree6db0bdae1d0b3805a75d7f69533e5f3ca29fe8c8 /lib
parent736019b767548268044e665bd6cde4b5e34c0bd3 (diff)
downloadtracifyjs-d3d1d11926de43fc1ec74ae3a4d24a884d80d91f.tar.gz
tracifyjs-d3d1d11926de43fc1ec74ae3a4d24a884d80d91f.zip
fix corner case in `ie8` & `rename` (#3474)
fixes #3473
Diffstat (limited to 'lib')
-rw-r--r--lib/scope.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/scope.js b/lib/scope.js
index 83df3fde..1b570515 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -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) {