@@ -556,7 +556,7 @@ reduce_iife_3: {
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
reduce_lambda: {
|
||||
reduce_lambda_1: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
@@ -588,6 +588,43 @@ reduce_lambda: {
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
reduce_lambda_2: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
passes: 2,
|
||||
reduce_vars: true,
|
||||
side_effects: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
(function(f, a, b) {
|
||||
f = () => {
|
||||
console.log(a, b);
|
||||
};
|
||||
a = "foo", b = 42;
|
||||
f();
|
||||
b = "bar";
|
||||
f();
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function(f, a, b) {
|
||||
f = () => {
|
||||
console.log("foo", b);
|
||||
};
|
||||
b = 42;
|
||||
f();
|
||||
b = "bar";
|
||||
f();
|
||||
})();
|
||||
}
|
||||
expect_stdout: [
|
||||
"foo 42",
|
||||
"foo bar",
|
||||
]
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
single_use_recursive: {
|
||||
options = {
|
||||
reduce_vars: true,
|
||||
|
||||
@@ -6413,3 +6413,125 @@ issue_5067: {
|
||||
}
|
||||
expect: {}
|
||||
}
|
||||
|
||||
issue_5096_1: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
passes: 2,
|
||||
reduce_vars: true,
|
||||
side_effects: true,
|
||||
toplevel: true,
|
||||
}
|
||||
input: {
|
||||
var a, b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect: {
|
||||
var a, b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_5096_2: {
|
||||
options = {
|
||||
passes: 2,
|
||||
reduce_vars: true,
|
||||
side_effects: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var a, b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect: {
|
||||
var a, b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_5096_3: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
side_effects: true,
|
||||
toplevel: true,
|
||||
}
|
||||
input: {
|
||||
var b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
var a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect: {
|
||||
var b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
var a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_5096_4: {
|
||||
options = {
|
||||
reduce_vars: true,
|
||||
side_effects: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
var a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect: {
|
||||
var b = "FAIL", c = 1;
|
||||
do {
|
||||
a && a();
|
||||
var a = function() {
|
||||
b = "PASS";
|
||||
};
|
||||
} while (c--);
|
||||
console.log(b);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user