diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-04-24 21:38:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-24 21:38:55 +0800 |
commit | 6fe20dbe33bc78b161489207287c9154d5d32fd4 (patch) | |
tree | e0b5f53eda02d4407fb8367f7f2859a0848f85c6 /test/compress/comparisons.js | |
parent | 7ccdf3337b8c08e560870d4e440d52f176a252ae (diff) | |
download | tracifyjs-6fe20dbe33bc78b161489207287c9154d5d32fd4.tar.gz tracifyjs-6fe20dbe33bc78b161489207287c9154d5d32fd4.zip |
enhance `comparisons` (#3379)
Diffstat (limited to 'test/compress/comparisons.js')
-rw-r--r-- | test/compress/comparisons.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/compress/comparisons.js b/test/compress/comparisons.js index 434f09c9..46805625 100644 --- a/test/compress/comparisons.js +++ b/test/compress/comparisons.js @@ -345,3 +345,23 @@ is_boolean_var: { } expect_stdout: "1" } + +is_defined: { + options = { + comparisons: true, + } + input: { + console.log(function a() { + return void 0 === a; + }()); + } + expect: { + console.log(function a() { + return a, false; + }()); + } + expect_stdout: "false" + expect_warnings: [ + "WARN: Expression always defined [test/compress/comparisons.js:2,19]", + ] +} |