fix corner case in assignments (#4522)

fixes #4521
This commit is contained in:
Alex Lam S.L
2021-01-08 05:03:21 +00:00
committed by GitHub
parent 6c419bc083
commit 7fe8c9150a
2 changed files with 17 additions and 3 deletions

View File

@@ -461,3 +461,17 @@ issue_3949_2: {
}
expect_stdout: "100"
}
issue_4521: {
options = {
assignments: true,
dead_code: true,
}
input: {
var a = (a = 42 | a) ? console.log(a) : 0;
}
expect: {
var a = (a |= 42) ? console.log(a) : 0;
}
expect_stdout: "42"
}