@@ -80,6 +80,7 @@ function Compressor(options, false_by_default) {
|
||||
switches : !false_by_default,
|
||||
top_retain : null,
|
||||
toplevel : !!(options && options["top_retain"]),
|
||||
typeofs : !false_by_default,
|
||||
unsafe : false,
|
||||
unsafe_comps : false,
|
||||
unsafe_Func : false,
|
||||
@@ -3591,7 +3592,8 @@ merge(Compressor.prototype, {
|
||||
case "==":
|
||||
case "!=":
|
||||
// "undefined" == typeof x => undefined === x
|
||||
if (self.left instanceof AST_String
|
||||
if (compressor.option("typeofs")
|
||||
&& self.left instanceof AST_String
|
||||
&& self.left.value == "undefined"
|
||||
&& self.right instanceof AST_UnaryPrefix
|
||||
&& self.right.operator == "typeof") {
|
||||
|
||||
Reference in New Issue
Block a user