diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-29 20:53:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-29 20:53:03 +0800 |
commit | 2e41cd6394ad389080b446c20f519fc3920f81c7 (patch) | |
tree | 72ce7ca1887e388bf2a9c23d3bf2e41738daf002 /test/compress/issue-597.js | |
parent | 09f77c7d4d37350102c36b270b553f45e706d0c8 (diff) | |
download | tracifyjs-2e41cd6394ad389080b446c20f519fc3920f81c7.tar.gz tracifyjs-2e41cd6394ad389080b446c20f519fc3920f81c7.zip |
fix missing parentheses around NaN/Infinity shorthands (#1726)
fixes #1724
fixes #1725
Diffstat (limited to 'test/compress/issue-597.js')
-rw-r--r-- | test/compress/issue-597.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/issue-597.js b/test/compress/issue-597.js index 3a501532..2aaaf3f1 100644 --- a/test/compress/issue-597.js +++ b/test/compress/issue-597.js @@ -107,3 +107,27 @@ beautify_on_2: { } expect_exact: "console.log(null.toString(), (void 0).toString());" } + +issue_1724: { + input: { + var a = 0; + ++a % Infinity | Infinity ? a++ : 0; + console.log(a); + } + expect: { + var a = 0; + ++a % (1/0) | 1/0 ? a++ : 0; + console.log(a); + } + expect_stdout: "2" +} + +issue_1725: { + input: { + ([].length === 0) % Infinity ? console.log("PASS") : console.log("FAIL"); + } + expect: { + (0 === [].length) % (1/0) ? console.log("PASS") : console.log("FAIL"); + } + expect_stdout: "PASS" +} |