fix corner cases with yield (#4771)

fixes #4769
This commit is contained in:
Alex Lam S.L
2021-03-13 20:39:30 +00:00
committed by GitHub
parent 241113200e
commit 73e6b2550b
2 changed files with 43 additions and 2 deletions

View File

@@ -950,3 +950,43 @@ issue_4641_2: {
]
node_version: ">=10"
}
issue_4769_1: {
options = {
side_effects: true,
}
input: {
console.log(function*() {
(function({} = yield => {}) {})();
}().next().done);
}
expect: {
console.log(function*() {
(function({} = yield => {}) {})();
}().next().done);
}
expect_stdout: "true"
node_version: ">=6"
}
issue_4769_2: {
options = {
inline: true,
}
input: {
console.log(function*() {
return function({} = yield => {}) {
return "PASS";
}();
}().next().value);
}
expect: {
console.log(function*() {
return function({} = yield => {}) {
return "PASS";
}();
}().next().value);
}
expect_stdout: "PASS"
node_version: ">=6"
}