enhance inline & unused (#5245)

This commit is contained in:
Alex Lam S.L
2022-01-01 21:40:43 +00:00
committed by GitHub
parent 8d0422b6f3
commit 87a7426598
17 changed files with 992 additions and 236 deletions

View File

@@ -570,6 +570,50 @@ inlined_assignments: {
expect_stdout: "PASS"
}
inilne_for: {
options = {
inline: true,
join_vars: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = function() {
for (; console.log("PASS"););
};
a();
}
expect: {
for (; console.log("PASS"););
}
expect_stdout: "PASS"
}
inilne_var: {
options = {
inline: true,
join_vars: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
A = "PASS";
var a = function() {
var b = A;
for (b in console.log(b));
};
a();
}
expect: {
A = "PASS";
var b = A;
for (b in console.log(b));
}
expect_stdout: "PASS"
}
typescript_enum: {
rename = true
options = {