From 17e73121fa641c14fd9f4cdd3310bf3e8ec037d0 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 1 Jun 2017 00:56:28 +0800 Subject: enhance `unsafe` `evaluate` (#2037) --- test/compress/evaluate.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test') 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" +} -- cgit v1.2.3