fix TreeWalker scan order (#3114)

fixes #3113
This commit is contained in:
Alex Lam S.L
2018-05-03 00:27:45 +08:00
committed by GitHub
parent 1a314e9f60
commit a0ca595c2c
2 changed files with 40 additions and 5 deletions

View File

@@ -5833,3 +5833,39 @@ issue_3110_3: {
"foo",
]
}
issue_3113: {
options = {
evaluate: true,
reduce_vars: true,
}
input: {
var c = 0;
(function() {
function f() {
while (g());
}
var a = f();
function g() {
a && a[c++];
}
g(a = 1);
})();
console.log(c);
}
expect: {
var c = 0;
(function() {
function f() {
while (g());
}
var a = f();
function g() {
a && a[c++];
}
g(a = 1);
})();
console.log(c);
}
expect_stdout: "1"
}