aboutsummaryrefslogtreecommitdiff
path: root/test/compress/comparisons.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-08-23 01:03:48 +0800
committerGitHub <noreply@github.com>2020-08-23 01:03:48 +0800
commitf2d486e771271ce03f25a50a6107cb87735a681d (patch)
treee5a274dde93d3a705626af569e90f58d2639e2c2 /test/compress/comparisons.js
parentfee677786ed35faa3eea7b9cd287730550ddd7d3 (diff)
downloadtracifyjs-f2d486e771271ce03f25a50a6107cb87735a681d.tar.gz
tracifyjs-f2d486e771271ce03f25a50a6107cb87735a681d.zip
enhance `comparisons` (#4062)
Diffstat (limited to 'test/compress/comparisons.js')
-rw-r--r--test/compress/comparisons.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/compress/comparisons.js b/test/compress/comparisons.js
index f93ccbe1..a04498ee 100644
--- a/test/compress/comparisons.js
+++ b/test/compress/comparisons.js
@@ -123,6 +123,29 @@ self_comparison_3: {
]
}
+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,