enhance collapse_vars (#2952)

- `a = b, b` => `a = b`
- `a.b = c, c()` => `(a.b = c)()`
This commit is contained in:
Alex Lam S.L
2018-02-28 15:19:32 +08:00
committed by GitHub
parent ace5811691
commit 36bca6934d
4 changed files with 782 additions and 25 deletions

View File

@@ -668,8 +668,7 @@ side_effects_cascade_2: {
}
expect: {
function f(a, b) {
b = a,
!a + (b += a) || (b += a),
!(b = a) + (b += a) || (b += a),
b = a;
}
}