aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 992d78f8..c994a3ab 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1751,14 +1751,14 @@ merge(Compressor.prototype, {
// XXX: intentionally falling down to the next case
case "==":
case "!=":
- if (self.left instanceof AST_String
- && self.left.value == "undefined"
- && self.right instanceof AST_UnaryPrefix
- && self.right.operator == "typeof"
- && compressor.option("unsafe")) {
- if (!(self.right.expression instanceof AST_SymbolRef)
- || !self.right.expression.undeclared()) {
- self.left = self.right.expression;
+ if (compressor.option("unsafe")
+ && self.left instanceof AST_UnaryPrefix
+ && self.left.operator == "typeof"
+ && self.right instanceof AST_String
+ && self.right.value == "undefined") {
+ if (!(self.left.expression instanceof AST_SymbolRef)
+ || !self.left.expression.undeclared()) {
+ self.left = self.left.expression;
self.right = make_node(AST_Undefined, self.left).optimize(compressor);
if (self.operator.length == 2) self.operator += "=";
}