fix reduce_vars on this (#2145)

fixes #2140
This commit is contained in:
Alex Lam S.L
2017-06-23 04:44:57 +08:00
committed by GitHub
parent 0692435f01
commit 3d5bc08185
2 changed files with 30 additions and 5 deletions

View File

@@ -2575,3 +2575,28 @@ accessor: {
}
expect_stdout: "1 1"
}
for_in_prop: {
options = {
reduce_vars: true,
}
input: {
var a = {
foo: function() {
for (this.b in [1, 2]);
}
};
a.foo();
console.log(a.b);
}
expect: {
var a = {
foo: function() {
for (this.b in [1, 2]);
}
};
a.foo();
console.log(a.b);
}
expect_stdout: "1"
}