aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-18 17:01:49 +0000
committerGitHub <noreply@github.com>2020-12-19 01:01:49 +0800
commit7d9dad02899fdc0a46ab030f9663e7f5bec2003b (patch)
tree50995d3865ef679c07ead586a1ac2beffb98b3ef /lib
parent44e494f16f5ce7fc1272e6ca6ae227f77623c2f9 (diff)
downloadtracifyjs-7d9dad02899fdc0a46ab030f9663e7f5bec2003b.tar.gz
tracifyjs-7d9dad02899fdc0a46ab030f9663e7f5bec2003b.zip
fix corner case with parentheses (#4409)
fixes #4408
Diffstat (limited to 'lib')
-rw-r--r--lib/output.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/output.js b/lib/output.js
index 7bb27d9b..3d8d74c9 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -1198,11 +1198,9 @@ function OutputStream(options) {
// need to take some precautions here:
// https://github.com/mishoo/UglifyJS/issues/60
if (noin) node.walk(new TreeWalker(function(node) {
- if (parens || node instanceof AST_Scope) return true;
- if (node instanceof AST_Binary && node.operator == "in") {
- parens = true;
- return true;
- }
+ if (parens) return true;
+ if (node instanceof AST_Binary && node.operator == "in") return parens = true;
+ if (node instanceof AST_Scope && !(node instanceof AST_Arrow && node.value)) return true;
}));
node.print(output, parens);
}