&& self.right instanceof AST_SymbolRef
&& self.left.definition() === self.right.definition()
&& is_object(self.left)) {
- return make_node(self.operator[0] == "=" ? AST_True : AST_False, self);
+ return make_node(self.operator[0] == "=" ? AST_True : AST_False, self).optimize(compressor);
}
break;
case "&&":
]
}
+self_comparison_4: {
+ options = {
+ booleans: true,
+ comparisons: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var o = {};
+ console.log(o == o, o != o);
+ console.log(o === o, o !== o);
+ }
+ expect: {
+ console.log(!0, !1);
+ console.log(!0, !1);
+ }
+ expect_stdout: [
+ "true false",
+ "true false",
+ ]
+}
+
issue_2857_1: {
options = {
comparisons: true,