fix corner case in inline (#4336)

fixes #4335
This commit is contained in:
Alex Lam S.L
2020-12-07 03:30:37 +00:00
committed by GitHub
parent 9eb65f3af3
commit 499f8d89ff
2 changed files with 78 additions and 8 deletions

View File

@@ -216,3 +216,51 @@ collapse_vars_3: {
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4335_1: {
options = {
inline: true,
}
input: {
var await = "PASS";
(async function() {
console.log(function() {
return await;
}());
})();
}
expect: {
var await = "PASS";
(async function() {
console.log(function() {
return await;
}());
})();
}
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4335_2: {
options = {
inline: true,
}
input: {
(async function() {
console.log(function() {
function await() {}
return "PASS";
}());
})();
}
expect: {
(async function() {
console.log(function() {
function await() {}
return "PASS";
}());
})();
}
expect_stdout: "PASS"
node_version: ">=8"
}