correctly count declarations after hoist_vars (#2297)

fixes #2295
This commit is contained in:
Alex Lam S.L
2017-09-03 17:23:31 +08:00
committed by GitHub
parent 71d52f147d
commit 3f355866cf
2 changed files with 22 additions and 0 deletions

View File

@@ -88,3 +88,24 @@ sequences_funs: {
}
}
}
issue_2295: {
options = {
collapse_vars: true,
hoist_vars: true,
}
input: {
function foo(o) {
var a = o.a;
if (a) return a;
var a = 1;
}
}
expect: {
function foo(o) {
var a = o.a;
if (a) return a;
a = 1;
}
}
}