minor
This commit is contained in:
@@ -768,21 +768,34 @@ function Compressor(options, false_by_default) {
|
|||||||
/* -----[ node squeezers ]----- */
|
/* -----[ node squeezers ]----- */
|
||||||
|
|
||||||
SQUEEZE(AST_Directive, function(self, compressor){
|
SQUEEZE(AST_Directive, function(self, compressor){
|
||||||
if (self.hoisted || self.scope.has_directive(self.value) !== self.scope) {
|
return self.optimize(compressor);
|
||||||
return new AST_EmptyStatement(self);
|
});
|
||||||
|
|
||||||
|
AST_Directive.DEFMETHOD("optimize", function(compressor){
|
||||||
|
if (this.hoisted || this.scope.has_directive(this.value) !== this.scope) {
|
||||||
|
return make_node(AST_EmptyStatement, this);
|
||||||
}
|
}
|
||||||
return self;
|
return this;
|
||||||
});
|
});
|
||||||
|
|
||||||
SQUEEZE(AST_Debugger, function(self, compressor){
|
SQUEEZE(AST_Debugger, function(self, compressor){
|
||||||
|
return self.optimize(compressor);
|
||||||
|
});
|
||||||
|
|
||||||
|
AST_Debugger.DEFMETHOD("optimize", function(compressor){
|
||||||
if (compressor.option("drop_debugger"))
|
if (compressor.option("drop_debugger"))
|
||||||
return new AST_EmptyStatement(self);
|
return make_node(AST_EmptyStatement, this);
|
||||||
|
return this;
|
||||||
});
|
});
|
||||||
|
|
||||||
SQUEEZE(AST_LabeledStatement, function(self, compressor){
|
SQUEEZE(AST_LabeledStatement, function(self, compressor){
|
||||||
self = self.clone();
|
self = self.clone();
|
||||||
self.body = self.body.squeeze(compressor);
|
self.body = self.body.squeeze(compressor);
|
||||||
return self.label.references.length == 0 ? self.body : self;
|
return self.optimize(compressor);
|
||||||
|
});
|
||||||
|
|
||||||
|
AST_LabeledStatement.DEFMETHOD("optimize", function(){
|
||||||
|
return this.label.references.length == 0 ? this.body : this;
|
||||||
});
|
});
|
||||||
|
|
||||||
SQUEEZE(AST_Statement, function(self, compressor){
|
SQUEEZE(AST_Statement, function(self, compressor){
|
||||||
|
|||||||
Reference in New Issue
Block a user