fix corner case in conditionals (#3244)

This commit is contained in:
Alex Lam S.L
2018-08-30 15:59:05 +08:00
committed by GitHub
parent 2bdaca10ae
commit ce7e220de4
2 changed files with 39 additions and 17 deletions

View File

@@ -1364,3 +1364,23 @@ cond_seq_assign_2: {
"42",
]
}
cond_seq_assign_3: {
options = {
conditionals: true,
}
input: {
var c = 0;
if (this)
c = 1 + c, c = c + 1;
else
c = 1 + c, c = c + 1;
console.log(c);
}
expect: {
var c = 0;
this, c = 1 + c, c += 1;
console.log(c);
}
expect_stdout: "2"
}