@@ -10234,22 +10234,24 @@ Compressor.prototype.compress = function(node) {
|
||||
}
|
||||
|
||||
function varify(self, compressor) {
|
||||
return all(self.definitions, function(defn) {
|
||||
if (all(self.definitions, function(defn) {
|
||||
return !defn.name.match_symbol(function(node) {
|
||||
if (node instanceof AST_SymbolDeclaration) return !can_varify(compressor, node);
|
||||
}, true);
|
||||
}) ? to_var(self, compressor.find_parent(AST_Scope)) : self;
|
||||
})) return to_var(self, compressor.find_parent(AST_Scope));
|
||||
}
|
||||
|
||||
OPT(AST_Const, function(self, compressor) {
|
||||
if (!compressor.option("varify")) return self;
|
||||
var decl = varify(self, compressor);
|
||||
if (decl) return decl;
|
||||
if (can_letify(self, compressor, 0)) return to_let(self);
|
||||
return varify(self, compressor);
|
||||
return self;
|
||||
});
|
||||
|
||||
OPT(AST_Let, function(self, compressor) {
|
||||
if (!compressor.option("varify")) return self;
|
||||
return varify(self, compressor);
|
||||
return varify(self, compressor) || self;
|
||||
});
|
||||
|
||||
function trim_optional_chain(node, compressor) {
|
||||
|
||||
Reference in New Issue
Block a user