enhance evaluate & inline (#3580)

This commit is contained in:
Alex Lam S.L
2019-11-13 04:17:09 +08:00
committed by GitHub
parent 0d17c5b0fa
commit d6fd18d0b0
7 changed files with 45 additions and 37 deletions

View File

@@ -1900,3 +1900,24 @@ issue_3568: {
}
expect_stdout: "NaN"
}
conditional_function: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
}
input: {
function f(a) {
return a && "undefined" != typeof A ? A : 42;
}
console.log(f(0), f(1));
}
expect: {
function f(a) {
return a && "undefined" != typeof A ? A : 42;
}
console.log(42, f(1));
}
expect_stdout: "42 42"
}