fix corner case in hoist_props (#4986)

fixes #4985
This commit is contained in:
Alex Lam S.L
2021-05-30 05:00:32 +01:00
committed by GitHub
parent 7e88d52fae
commit 23b9f36bd8
2 changed files with 26 additions and 1 deletions

View File

@@ -1580,3 +1580,27 @@ issue_4848: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4985: {
options = {
hoist_props: true,
reduce_vars: true,
toplevel: true,
}
input: {
"use strict";
let a = { p: 42 };
console.log(function() {
a;
}());
}
expect: {
"use strict";
let a = { p: 42 };
console.log(function() {
a;
}());
}
expect_stdout: "undefined"
node_version: ">=4"
}