diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-06-01 00:56:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-01 00:56:28 +0800 |
commit | 17e73121fa641c14fd9f4cdd3310bf3e8ec037d0 (patch) | |
tree | d24c9fdaf9789f97bf611a01fda99ba4061f8bfd /test | |
parent | f71e8fd9488b28b92e6897254b7a54cf51471557 (diff) | |
download | tracifyjs-17e73121fa641c14fd9f4cdd3310bf3e8ec037d0.tar.gz tracifyjs-17e73121fa641c14fd9f4cdd3310bf3e8ec037d0.zip |
enhance `unsafe` `evaluate` (#2037)
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/evaluate.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index a1e3d0be..020d7cf3 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -1037,3 +1037,31 @@ issue_1964_2: { } expect_stdout: "b" } + +array_slice_index: { + options = { + evaluate: true, + unsafe: true, + } + input: { + console.log([1,2,3].slice(1)[1]); + } + expect: { + console.log(3); + } + expect_stdout: "3" +} + +string_charCodeAt: { + options = { + evaluate: true, + unsafe: true, + } + input: { + console.log("foo".charCodeAt("bar".length)); + } + expect: { + console.log(NaN); + } + expect_stdout: "NaN" +} |