diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-03-19 01:34:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-19 01:34:25 +0800 |
commit | c520e99eda6a516ea275b58fc100eff378261145 (patch) | |
tree | 2c24f3634c9266b887efd05f0a5e281e9892f697 /test/compress | |
parent | 615ae37ca3a659df2ed304d7d30a43704fdd43ab (diff) | |
download | tracifyjs-c520e99eda6a516ea275b58fc100eff378261145.tar.gz tracifyjs-c520e99eda6a516ea275b58fc100eff378261145.zip |
enhance `comparisons` (#3347)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/comparisons.js (renamed from test/compress/comparing.js) | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/comparing.js b/test/compress/comparisons.js index 1ff29565..434f09c9 100644 --- a/test/compress/comparing.js +++ b/test/compress/comparisons.js @@ -323,3 +323,25 @@ is_number_unsafe: { } expect_stdout: "true" } + +is_boolean_var: { + options = { + comparisons: true, + reduce_vars: true, + } + input: { + console.log(function(a, b) { + for (var i = 0, c = !b; i < a.length; i++) + if (!a[i] === c) + return i; + }([ false, true ], 42)); + } + expect: { + console.log(function(a, b) { + for (var i = 0, c = !b; i < a.length; i++) + if (!a[i] == c) + return i; + }([ false, true ], 42)); + } + expect_stdout: "1" +} |