fix chained assignment with unused (#1540)

When #1450 optimises `a=b=42`, it stops after the first variable even if both are unused.

fixes #1539
This commit is contained in:
Alex Lam S.L
2017-03-03 04:45:20 +08:00
committed by GitHub
parent 4d63d4f5b3
commit 17b81350d4
2 changed files with 31 additions and 7 deletions

View File

@@ -679,3 +679,24 @@ const_assign: {
}
}
}
issue_1539: {
options = {
cascade: true,
sequences: true,
side_effects: true,
unused: true,
}
input: {
function f() {
var a, b;
a = b = 42;
return a;
}
}
expect: {
function f() {
return 42;
}
}
}