aboutsummaryrefslogtreecommitdiff
path: root/test/compress/arrays.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/arrays.js')
-rw-r--r--test/compress/arrays.js69
1 files changed, 69 insertions, 0 deletions
diff --git a/test/compress/arrays.js b/test/compress/arrays.js
index fff7e9b6..4767a9a5 100644
--- a/test/compress/arrays.js
+++ b/test/compress/arrays.js
@@ -355,3 +355,72 @@ constructor_good: {
expect_stdout: true
expect_warnings: []
}
+
+unsafe_evaluate_modified_binary: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ unsafe: true,
+ }
+ input: {
+ (function(a) {
+ (console && a).push(1);
+ if (a.length)
+ console.log("PASS");
+ })([]);
+ }
+ expect: {
+ (function(a) {
+ (console && a).push(1);
+ if (a.length)
+ console.log("PASS");
+ })([]);
+ }
+ expect_stdout: "PASS"
+}
+
+unsafe_evaluate_modified_conditional: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ unsafe: true,
+ }
+ input: {
+ (function(a) {
+ (console ? a : []).push(1);
+ if (a.length)
+ console.log("PASS");
+ })([]);
+ }
+ expect: {
+ (function(a) {
+ (console ? a : []).push(1);
+ if (a.length)
+ console.log("PASS");
+ })([]);
+ }
+ expect_stdout: "PASS"
+}
+
+unsafe_evaluate_modified_sequence: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ unsafe: true,
+ }
+ input: {
+ (function(a) {
+ (0, a).push(1);
+ if (a.length)
+ console.log("PASS");
+ })([]);
+ }
+ expect: {
+ (function(a) {
+ (0, a).push(1);
+ if (a.length)
+ console.log("PASS");
+ })([]);
+ }
+ expect_stdout: "PASS"
+}