From 1aade735d0d671f831c38c68923c417f180c6b9e Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Thu, 19 Jan 2017 17:28:47 +0800 Subject: [PATCH] make sure expression is AST_Binary --- lib/compress.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/compress.js b/lib/compress.js index 5879b93b..ee55faa4 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2592,9 +2592,10 @@ merge(Compressor.prototype, { } // x && (y && z) ==> x && y && z // x || (y || z) ==> x || y || z - if (self.right instanceof AST_Binary - && self.right.operator == self.operator - && (self.operator == "&&" || self.operator == "||")) + if (self instanceof AST_Binary + && self.right instanceof AST_Binary + && self.right.operator === self.operator + && (self.operator === "&&" || self.operator === "||")) { self.left = make_node(AST_Binary, self.left, { operator : self.operator,