enhance collapse_vars (#1862)

- extend expression types
  - `a++`
  - `a=x;`
- extend scan range
  - `for(init;;);`
  - `switch(expr){case expr:}`
  - `a = x; a = a || y;`
- terminate upon `debugger;`

closes #1821
fixes #27
fixes #315
fixes #1858
This commit is contained in:
Alex Lam S.L
2017-05-06 16:15:43 +08:00
committed by GitHub
parent 5a25d24b56
commit dee5a27516
4 changed files with 753 additions and 173 deletions

View File

@@ -18,9 +18,7 @@ chained_evaluation_1: {
expect: {
(function() {
(function() {
var c;
c = f(1);
c.bar = 1;
f(1).bar = 1;
})();
})();
}
@@ -46,9 +44,8 @@ chained_evaluation_2: {
expect: {
(function() {
(function() {
var c, b = "long piece of string";
c = f(b);
c.bar = b;
var b = "long piece of string";
f(b).bar = b;
})();
})();
}