diff options
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" +} |