diff options
Diffstat (limited to 'test/compress/comparing.js')
-rw-r--r-- | test/compress/comparing.js | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/test/compress/comparing.js b/test/compress/comparing.js index c51fac31..11804cbb 100644 --- a/test/compress/comparing.js +++ b/test/compress/comparing.js @@ -73,4 +73,41 @@ dont_change_in_or_instanceof_expressions: { 1 instanceof 1; null instanceof null; } -}
\ No newline at end of file +} + +self_comparison_1: { + options = { + comparisons: true, + } + input: { + a === a; + a !== b; + b.c === a.c; + b.c !== b.c; + } + expect: { + a == a; + a !== b; + b.c === a.c; + b.c != b.c; + } +} + +self_comparison_2: { + options = { + comparisons: true, + reduce_vars: true, + toplevel: true, + } + input: { + function f() {} + var o = {}; + console.log(f != f, o === o); + } + expect: { + function f() {} + var o = {}; + console.log(false, true); + } + expect_stdout: "false true" +} |