Fix hoisting the var in ForIn

Close #913
This commit is contained in:
Mihai Bazon
2016-01-05 13:56:52 +02:00
parent 174404c0f3
commit fe4e9f9d97
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
keep_var_for_in: {
options = {
hoist_vars: true,
unused: true
};
input: {
(function(obj){
var foo = 5;
for (var i in obj)
return foo;
})();
}
expect: {
(function(obj){
var i, foo = 5;
for (i in obj)
return foo;
})();
}
}