fix corner case in default_values (#4497)

fixes #4496
This commit is contained in:
Alex Lam S.L
2021-01-02 14:51:53 +00:00
committed by GitHub
parent 15ef272790
commit 110c1ac097
2 changed files with 32 additions and 4 deletions

View File

@@ -1313,3 +1313,31 @@ issue_4485_3: {
expect_stdout: true
node_version: ">=6"
}
issue_4496: {
options = {
default_values: true,
unused: true,
}
input: {
(function f(a = 0) {
console.log(function(b) {
a && b();
return a;
}(f));
})(42);
}
expect: {
(function f(a = 0) {
console.log(function(b) {
a && b();
return a;
}(f));
})(42);
}
expect_stdout: [
"0",
"42",
]
node_version: ">=6"
}