diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-04-09 03:18:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-09 03:18:14 +0800 |
commit | d6fbc365e2f00eaaba0f1dd19e81037a64976def (patch) | |
tree | 65bd93dcc4b01c4b2cb2b331d3e87a1ff19e95a3 /test | |
parent | 9a978843f516391495c4fd446f2e01c2f47369ff (diff) | |
download | tracifyjs-d6fbc365e2f00eaaba0f1dd19e81037a64976def.tar.gz tracifyjs-d6fbc365e2f00eaaba0f1dd19e81037a64976def.zip |
fix LHS cases for NaN & friends (#1804)
`Infinity = beyond` should not become `1/0 = beyond`
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/evaluate.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index 3c16e201..611acf0d 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -957,3 +957,35 @@ delete_binary_2: { } expect_stdout: true } + +Infinity_NaN_undefined_LHS: { + beautify = { + beautify: true, + } + input: { + function f() { + Infinity = Infinity; + ++Infinity; + Infinity--; + NaN *= NaN; + ++NaN; + NaN--; + undefined |= undefined; + ++undefined; + undefined--; + } + } + expect_exact: [ + "function f() {", + " Infinity = 1 / 0;", + " ++Infinity;", + " Infinity--;", + " NaN *= NaN;", + " ++NaN;", + " NaN--;", + " undefined |= void 0;", + " ++undefined;", + " undefined--;", + "}", + ] +} |