aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-06 16:51:37 +0800
committerGitHub <noreply@github.com>2019-10-06 16:51:37 +0800
commit8a4c7077bb78b45cd920a6804011ba433c196481 (patch)
treee2b8a7f6893e7729d285f7413f38f94a3b08bc5e
parent0a63f2f2b09251ad3f6b771dcf1ae1b4b9c921d7 (diff)
downloadtracifyjs-8a4c7077bb78b45cd920a6804011ba433c196481.tar.gz
tracifyjs-8a4c7077bb78b45cd920a6804011ba433c196481.zip
account for `catch` in constant lambda expressions (#3454)
-rw-r--r--lib/compress.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 5ea5d00b..bffb6f74 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3403,6 +3403,12 @@ merge(Compressor.prototype, {
var inner_scopes = [];
self.walk(new TreeWalker(function(node, descend) {
if (!result) return true;
+ if (node instanceof AST_Catch) {
+ inner_scopes.push(node.argname.scope);
+ descend();
+ inner_scopes.pop();
+ return true;
+ }
if (node instanceof AST_Scope && node !== self) {
inner_scopes.push(node);
descend();