fix corner case in collapse_vars (#5200)

fixes #5199
This commit is contained in:
Alex Lam S.L
2021-11-27 17:43:43 +00:00
committed by GitHub
parent 12227ebbb0
commit 3f8f0e246e
2 changed files with 49 additions and 1 deletions

View File

@@ -743,3 +743,29 @@ issue_5145_2: {
]
node_version: ">=4"
}
issue_5199: {
options = {
collapse_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = function() {
console.log(typeof b);
}``;
{
const b = a;
}
}
expect: {
var a = function() {
console.log(typeof b);
}``;
{
const b = a;
}
}
expect_stdout: "undefined"
node_version: ">=4"
}