enhance inline (#5226)

This commit is contained in:
Alex Lam S.L
2021-12-21 05:03:11 +00:00
committed by GitHub
parent 86406e71ec
commit ba42cbad3f
15 changed files with 798 additions and 136 deletions

View File

@@ -1219,9 +1219,9 @@ issue_4248: {
expect_stdout: "PASS"
}
issue_4261: {
issue_4261_1: {
options = {
inline: true,
inline: 3,
reduce_funcs: true,
reduce_vars: true,
toplevel: true,
@@ -1259,6 +1259,45 @@ issue_4261: {
expect_stdout: "42"
}
issue_4261_2: {
options = {
if_return: true,
inline: true,
reduce_funcs: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
{
const a = 42;
(function() {
function f() {
console.log(a);
}
function g() {
while (f());
}
(function() {
while (g());
})();
})();
}
}
expect: {
{
const a = 42;
(function() {
function g() {
while (void console.log(a));
}
while (g());
})();
}
}
expect_stdout: "42"
}
issue_4274_1: {
options = {
loops: true,