fix corner cases in inline (#5255)

fixes #5254
This commit is contained in:
Alex Lam S.L
2022-01-02 13:24:41 +00:00
committed by GitHub
parent f7841bc8b8
commit 7889192cae
4 changed files with 204 additions and 18 deletions

View File

@@ -1727,3 +1727,28 @@ issue_4965_2: {
expect_stdout: "undefined"
node_version: ">=4"
}
issue_5254: {
options = {
inline: true,
toplevel: true,
}
input: {
do {
(function() {
const a = console.log;
a && a("foo");
})();
} while (console.log("bar"));
}
expect: {
do {
const a = console.log;
a && a("foo");
} while (console.log("bar"));
}
expect_stdout: [
"foo",
"bar",
]
}