enhance varify (#5737)

This commit is contained in:
Alex Lam S.L
2022-11-21 03:30:02 +00:00
committed by GitHub
parent 1d400f1a25
commit 21aff996a5
3 changed files with 78 additions and 6 deletions

View File

@@ -329,6 +329,42 @@ forin_const_2: {
node_version: ">=6"
}
forin_const_3: {
options = {
module: true,
reduce_vars: true,
toplevel: true,
varify: true,
}
input: {
"use strict";
const o = {
p: 42,
q: "PASS",
};
for (const k in o)
(function f() {
console.log(k, o[k]);
})();
}
expect: {
"use strict";
let o = {
p: 42,
q: "PASS",
};
for (let k in o)
(function f() {
console.log(k, o[k]);
})();
}
expect_stdout: [
"p 42",
"q PASS",
]
node_version: ">=4"
}
forin_let_1: {
options = {
join_vars: true,