aboutsummaryrefslogtreecommitdiff
path: root/lib/scope.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-16 12:18:27 +0800
committerGitHub <noreply@github.com>2019-10-16 12:18:27 +0800
commit1549db70e60a1ae74f2b7ffc511ef123733f9557 (patch)
tree418015e8724ba48051aff3b9dfe0b4d5d15ca04b /lib/scope.js
parent8ff9a3c8fb89ac40fea0dd1cd249e8b94a690c2e (diff)
downloadtracifyjs-1549db70e60a1ae74f2b7ffc511ef123733f9557.tar.gz
tracifyjs-1549db70e60a1ae74f2b7ffc511ef123733f9557.zip
fix corner case in `ie8` (#3487)
fixes #3486
Diffstat (limited to 'lib/scope.js')
-rw-r--r--lib/scope.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/scope.js b/lib/scope.js
index b40807fa..131235f6 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -194,7 +194,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
if (node instanceof AST_SymbolCatch) {
var scope = node.thedef.defun;
if (scope.name instanceof AST_SymbolLambda && scope.name.name == node.name) {
- scope = scope.parent_scope;
+ scope = scope.parent_scope.resolve();
}
redefine(node, scope);
return true;
@@ -202,7 +202,11 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
if (node instanceof AST_SymbolLambda) {
var def = node.thedef;
redefine(node, node.scope.parent_scope.resolve());
- if (def.init) node.thedef.init = def.init;
+ if (typeof node.thedef.init !== "undefined") {
+ node.thedef.init = false;
+ } else if (def.init) {
+ node.thedef.init = def.init;
+ }
return true;
}
}));