fix corner case in assignments (#3376)

fixes #3375
This commit is contained in:
Alex Lam S.L
2019-04-24 02:50:15 +08:00
committed by GitHub
parent f01cc1e413
commit a84beafd1b
4 changed files with 56 additions and 9 deletions

View File

@@ -289,3 +289,25 @@ increment_decrement_2: {
}
expect_stdout: "42"
}
issue_3375: {
options = {
assignments: true,
reduce_vars: true,
}
input: {
console.log(typeof function(b) {
var a = b += 1;
--b;
return a;
}("object"));
}
expect: {
console.log(typeof function(b) {
var a = b += 1;
--b;
return a;
}("object"));
}
expect_stdout: "string"
}