fix corner case in functions (#5035)

fixes #5034
This commit is contained in:
Alex Lam S.L
2021-06-24 12:43:46 +01:00
committed by GitHub
parent 82772ccb12
commit 1a064b6e74
3 changed files with 82 additions and 3 deletions

View File

@@ -1216,3 +1216,33 @@ issue_5032_webkit: {
]
node_version: ">=4"
}
issue_5034: {
options = {
functions: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(function() {
var yield = function f() {
return function*() {
return f;
};
};
return yield()().next().value === yield;
}() ? "PASS" : "FAIL");
}
expect: {
console.log(function() {
var yield = function f() {
return function*() {
return f;
};
};
return yield()().next().value === yield;
}() ? "PASS" : "FAIL");
}
expect_stdout: "PASS"
node_version: ">=4"
}