fix corner cases in rename & varify (#4955)

fixes #4954
This commit is contained in:
Alex Lam S.L
2021-05-23 23:54:48 +01:00
committed by GitHub
parent 5d4e6e3bdc
commit 8b0c836515
5 changed files with 118 additions and 12 deletions

View File

@@ -575,3 +575,41 @@ issue_4933_2: {
}
expect_stdout: "undefined"
}
issue_4954: {
options = {
functions: true,
reduce_vars: true,
unused: true,
varify: true,
}
input: {
"use strict";
(function() {
{
let a = console;
console.log(typeof a);
}
{
let a = function() {};
a && console.log(typeof a);
}
})();
}
expect: {
"use strict";
(function() {
var a = console;
console.log(typeof a);
{
let a = function() {};
a && console.log(typeof a);
}
})();
}
expect_stdout: [
"object",
"function",
]
node_version: ">=4"
}