fix corner case in evaluate (#5139)

fixes #5138
This commit is contained in:
Alex Lam S.L
2021-09-30 19:52:21 +01:00
committed by GitHub
parent 0b2573c3fa
commit 940887f20f
2 changed files with 42 additions and 4 deletions

View File

@@ -1904,3 +1904,37 @@ issue_5065: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5138_1: {
options = {
evaluate: true,
}
input: {
console.log(function(a, b = a = "FAIL") {
return a;
}() && "PASS");
}
expect: {
console.log(function(a, b = a = "FAIL") {
return a;
}() && "PASS");
}
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5138_2: {
options = {
evaluate: true,
}
input: {
console.log(function(a, b = a = "FAIL 1") {
return a;
}(null, "FAIL 2") || "PASS");
}
expect: {
console.log((null, "PASS"));
}
expect_stdout: "PASS"
node_version: ">=6"
}