diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-09-04 03:14:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 10:14:39 +0800 |
commit | 226aa1f76b557aee6eed50e6a578d88a2c656cf2 (patch) | |
tree | 9f4fc338a98f49e3ae7a74a40c6bbe8c7cc0ff3f /test/compress | |
parent | 6e235602fb9d7876150a0abf5c918e28db240f2a (diff) | |
download | tracifyjs-226aa1f76b557aee6eed50e6a578d88a2c656cf2.tar.gz tracifyjs-226aa1f76b557aee6eed50e6a578d88a2c656cf2.zip |
enhance `unsafe_math` (#4093)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/numbers.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/compress/numbers.js b/test/compress/numbers.js index 9fca46f3..32987a6b 100644 --- a/test/compress/numbers.js +++ b/test/compress/numbers.js @@ -637,6 +637,22 @@ evaluate_7_unsafe_math: { ] } +evaluate_8_unsafe_math: { + options = { + evaluate: true, + unsafe_math: true, + } + input: { + var a = [ "42" ]; + console.log(a * (1 / 7)); + } + expect: { + var a = [ "42" ]; + console.log(+a / 7); + } + expect_stdout: "6" +} + NaN_redefined: { options = { evaluate: true, |