diff options
Diffstat (limited to 'test/compress/evaluate.js')
-rw-r--r-- | test/compress/evaluate.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index e5ecc6d5..4fecd701 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -560,6 +560,8 @@ unsafe_array: { input: { var a = "PASS"; Array.prototype[1] = a; + console.log([, ].length); + console.log("" + [, , ]); console.log([1, , 3][1]); console.log([1, 2, 3, a] + 1); console.log([1, 2, 3, 4] + 1); @@ -574,6 +576,8 @@ unsafe_array: { expect: { var a = "PASS"; Array.prototype[1] = a; + console.log([, ].length); + console.log("" + [, , ]); console.log([1, , 3][1]); console.log([1, 2, 3, a] + 1); console.log("1,2,3,41"); @@ -586,6 +590,8 @@ unsafe_array: { console.log([[1, 2], , [3, 4]][1][1] + 1); } expect_stdout: [ + "1", + ",PASS", "PASS", "1,2,3,PASS1", "1,2,3,41", @@ -2770,3 +2776,39 @@ issue_3988: { } expect_stdout: "0" } + +operator_in: { + options = { + evaluate: true, + unsafe: true, + } + input: { + Object.prototype.PASS = 0; + console.log(0 in [ 1 ]); + console.log(0 in [ , ]); + console.log(0 / 0 in { NaN: 2 }); + console.log("PASS" in { }); + console.log("FAIL" in { }); + console.log("toString" in { }); + console.log("toString" in { toString: 3 }); + } + expect: { + Object.prototype.PASS = 0; + console.log(true); + console.log(0 in [ , ]); + console.log(true); + console.log("PASS" in { }); + console.log("FAIL" in { }); + console.log("toString" in { }); + console.log(true); + } + expect_stdout: [ + "true", + "false", + "true", + "true", + "false", + "true", + "true", + ] +} |