fix corner cases in inline (#4640)

fixes #4639
This commit is contained in:
Alex Lam S.L
2021-02-10 12:40:57 +00:00
committed by GitHub
parent a98ec7e4df
commit c6e287331d
4 changed files with 77 additions and 11 deletions

View File

@@ -96,6 +96,18 @@ pause_resume: {
node_version: ">=4"
}
arrow_yield: {
input: {
yield = "PASS";
console.log(function*() {
return () => yield || "FAIL";
}().next().value());
}
expect_exact: 'yield="PASS";console.log(function*(){return()=>yield||"FAIL"}().next().value());'
expect_stdout: "PASS"
node_version: ">=4"
}
for_of: {
input: {
function* f() {
@@ -833,3 +845,47 @@ issue_4633: {
]
node_version: ">=4"
}
issue_4639_1: {
options = {
inline: true,
}
input: {
console.log(function*() {
return function() {
return yield => "PASS";
}();
}().next().value());
}
expect: {
console.log(function*() {
return function() {
return yield => "PASS";
}();
}().next().value());
}
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4639_2: {
options = {
inline: true,
}
input: {
(function*() {
console.log(function() {
return typeof yield;
}());
})().next();
}
expect: {
(function*() {
console.log(function() {
return typeof yield;
}());
})().next();
}
expect_stdout: "undefined"
node_version: ">=4"
}