fix corner case in inline (#4223)

fixes #4222
This commit is contained in:
Alex Lam S.L
2020-10-15 14:52:40 +01:00
committed by GitHub
parent 3d71e97dd1
commit 4f833937fe
2 changed files with 31 additions and 1 deletions

View File

@@ -1104,3 +1104,33 @@ issue_4220: {
}
expect_stdout: true
}
issue_4222: {
options = {
inline: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
{
const a = function() {
return function() {};
};
var b = a();
}
b();
console.log(typeof a);
}
expect: {
{
const a = function() {
return function() {};
};
var b = a();
}
b();
console.log(typeof a);
}
expect_stdout: true
}