enhance join_vars & sequences (#2697)

- nudge declarations without assignments
  - within `AST_BlockStatement`
  - across `AST_If`
This commit is contained in:
Alex Lam S.L
2018-01-01 00:09:26 +08:00
committed by GitHub
parent da82fa59a7
commit 673b071637
4 changed files with 160 additions and 18 deletions

View File

@@ -1203,3 +1203,24 @@ issue_2560: {
"2",
]
}
hoist_decl: {
options = {
conditionals: true,
join_vars: true,
sequences: true,
}
input: {
if (x()) {
var a;
y();
} else {
z();
var b;
}
}
expect: {
var a, b;
x() ? y() : z();
}
}