fix corner case in assignments (#3407)

fixes #3406
This commit is contained in:
Alex Lam S.L
2019-05-12 03:52:46 +08:00
committed by GitHub
parent e88c439eac
commit 54cb678055
5 changed files with 77 additions and 55 deletions

View File

@@ -311,39 +311,3 @@ issue_3375: {
}
expect_stdout: "string"
}
issue_3402: {
options = {
assignments: true,
evaluate: true,
functions: true,
passes: 2,
reduce_vars: true,
side_effects: true,
toplevel: true,
typeofs: true,
unused: true,
}
input: {
var f = function f() {
f = 42;
console.log(typeof f);
};
"function" == typeof f && f();
"function" == typeof f && f();
console.log(typeof f);
}
expect: {
function f() {
console.log(typeof f);
}
f();
f();
console.log(typeof f);
}
expect_stdout: [
"function",
"function",
"function",
]
}