@@ -11160,6 +11160,7 @@ Compressor.prototype.compress = function(node) {
|
||||
function append_var(decls, expressions, name, value) {
|
||||
var def = name.definition();
|
||||
if (!scope.var_names().has(name.name)) {
|
||||
if (def.first_decl === name) def.first_decl = null;
|
||||
scope.var_names().set(name.name, true);
|
||||
decls.push(make_node(AST_VarDef, name, {
|
||||
name: name,
|
||||
|
||||
@@ -2294,3 +2294,37 @@ issue_5591: {
|
||||
]
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
issue_5741: {
|
||||
options = {
|
||||
inline: true,
|
||||
join_vars: true,
|
||||
reduce_vars: true,
|
||||
}
|
||||
input: {
|
||||
"use strict";
|
||||
(function(a) {
|
||||
let b = function() {
|
||||
var c = a;
|
||||
console.log(c);
|
||||
}();
|
||||
function g() {
|
||||
a++;
|
||||
b;
|
||||
}
|
||||
})("PASS");
|
||||
}
|
||||
expect: {
|
||||
"use strict";
|
||||
(function(a) {
|
||||
let b = (c = a, void console.log(c));
|
||||
var c;
|
||||
function g() {
|
||||
a++;
|
||||
b;
|
||||
}
|
||||
})("PASS");
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user