fix unsafe evaluate of AST_Function (#2920)

fixes #2919
This commit is contained in:
Alex Lam S.L
2018-02-16 17:21:46 +08:00
committed by GitHub
parent a3dfeea144
commit a2a9459684
3 changed files with 45 additions and 5 deletions

View File

@@ -5527,3 +5527,21 @@ issue_2869: {
}
expect_stdout: "PASS"
}
issue_2919: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unsafe: true,
unused: true,
}
input: {
var arr = [ function() {} ];
console.log(typeof arr[0]);
}
expect: {
console.log("function");
}
expect_stdout: "function"
}