support logical assignment operators (#4813)

This commit is contained in:
Alex Lam S.L
2021-03-22 20:59:43 +00:00
committed by GitHub
parent 51bdb7281b
commit f9055df44d
5 changed files with 157 additions and 43 deletions

View File

@@ -2868,7 +2868,7 @@ lvalues_def: {
expect_stdout: true
}
compound_assignment: {
compound_assignment_1: {
options = {
collapse_vars: true,
}
@@ -2887,6 +2887,23 @@ compound_assignment: {
expect_stdout: "4"
}
compound_assignment_2: {
options = {
collapse_vars: true,
}
input: {
var a;
a = 1;
for (a += a + 2; console.log(a););
}
expect: {
var a;
a = 1;
for (a += a + 2; console.log(a););
}
expect_stdout: "4"
}
issue_2187_1: {
options = {
collapse_vars: true,