n--;
CHANGED = true;
var left = prev.body;
- return make_sequence(left, [ left, right ]).transform(compressor);
+ return make_sequence(left, [ left, right ]);
}
var n = 0, prev;
for (var i = 0; i < statements.length; i++) {
var stat = statements[i];
if (prev) {
if (stat instanceof AST_Exit) {
- stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor));
+ stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat)).transform(compressor);
} else if (stat instanceof AST_For) {
if (!(stat.init instanceof AST_Definitions)) {
var abort = false;
}
}
}
+
+issue_3490_1: {
+ options = {
+ conditionals: true,
+ dead_code: true,
+ inline: true,
+ sequences: true,
+ side_effects: true,
+ toplevel: true,
+ }
+ input: {
+ var b = 42, c = "FAIL";
+ if ({
+ 3: function() {
+ var a;
+ return (a && a.p) < this;
+ }(),
+ }) c = "PASS";
+ if (b) while ("" == typeof d);
+ console.log(c, b);
+ }
+ expect: {
+ var b = 42, c = "FAIL";
+ if (function() {
+ var a;
+ a && a.p;
+ }(), c = "PASS", b) while ("" == typeof d);
+ console.log(c, b);
+ }
+ expect_stdout: "PASS 42"
+}
+
+issue_3490_2: {
+ options = {
+ conditionals: true,
+ dead_code: true,
+ evaluate: true,
+ inline: true,
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ toplevel: true,
+ }
+ input: {
+ var b = 42, c = "FAIL";
+ if ({
+ 3: function() {
+ var a;
+ return (a && a.p) < this;
+ }(),
+ }) c = "PASS";
+ if (b) for (; "" == typeof d;);
+ console.log(c, b);
+ }
+ expect: {
+ var b = 42, c = "FAIL";
+ for (function() {
+ var a;
+ }(), c = "PASS", b; "" == typeof d;);
+ console.log(c, b);
+ }
+ expect_stdout: "PASS 42"
+}