aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-28 17:01:01 +0800
committerGitHub <noreply@github.com>2017-12-28 17:01:01 +0800
commitb95e3338d9704927046a030fe814302f55737e0d (patch)
tree946c2b3826709e79b71263f3219119b4196f5c71 /lib
parente40a0ee9c6c4dfbd9506dfcbb76ccd1565bc4ad9 (diff)
downloadtracifyjs-b95e3338d9704927046a030fe814302f55737e0d.tar.gz
tracifyjs-b95e3338d9704927046a030fe814302f55737e0d.zip
fix `pure_getters` on `AST_Binary` (#2681)
fixes #2678
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/compress.js b/lib/compress.js
index ac5cd235..4e3a8f82 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1693,15 +1693,8 @@ merge(Compressor.prototype, {
return this.operator == "void";
});
def(AST_Binary, function(compressor) {
- switch (this.operator) {
- case "&&":
- return this.left._dot_throw(compressor);
- case "||":
- return this.left._dot_throw(compressor)
- && this.right._dot_throw(compressor);
- default:
- return false;
- }
+ return (this.operator == "&&" || this.operator == "||")
+ && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor));
})
def(AST_Assign, function(compressor) {
return this.operator == "="