fix corner case in inline (#5297)

fixes #5296
This commit is contained in:
Alex Lam S.L
2022-01-14 20:18:35 +00:00
committed by GitHub
parent 87e8aca245
commit dfd6418878
4 changed files with 59 additions and 17 deletions

View File

@@ -6152,10 +6152,8 @@ issue_4265: {
}
expect: {
function f() {
return console, function() {
console.log(a);
var a;
}(), 0;
var a;
return console, console.log(a), 0;
}
f();
}
@@ -8046,3 +8044,40 @@ issue_5290: {
}
expect_stdout: "PASS"
}
issue_5296: {
options = {
inline: true,
}
input: {
var a = "PASS";
(function() {
for (var i = 0; i < 2; i++)
try {
return function() {
while (!console);
var b = b && (a = b) || "FAIL";
}();
} finally {
continue;
}
})();
console.log(a);
}
expect: {
var a = "PASS";
(function() {
for (var i = 0; i < 2; i++)
try {
b = void 0;
while (!console);
var b = b && (a = b) || "FAIL";
return;
} finally {
continue;
}
})();
console.log(a);
}
expect_stdout: "PASS"
}