minor clean-ups to evaluate (#2197)
This commit is contained in:
@@ -1692,12 +1692,9 @@ merge(Compressor.prototype, {
|
|||||||
});
|
});
|
||||||
def(AST_SymbolRef, function(compressor){
|
def(AST_SymbolRef, function(compressor){
|
||||||
if (!compressor.option("reduce_vars")) return this;
|
if (!compressor.option("reduce_vars")) return this;
|
||||||
this._eval = return_this;
|
|
||||||
var fixed = this.fixed_value();
|
var fixed = this.fixed_value();
|
||||||
if (!fixed) {
|
if (!fixed) return this;
|
||||||
delete this._eval;
|
this._eval = return_this;
|
||||||
return this;
|
|
||||||
}
|
|
||||||
var value = ev(fixed, compressor);
|
var value = ev(fixed, compressor);
|
||||||
if (value === fixed) {
|
if (value === fixed) {
|
||||||
delete this._eval;
|
delete this._eval;
|
||||||
@@ -1729,41 +1726,41 @@ merge(Compressor.prototype, {
|
|||||||
return this;
|
return this;
|
||||||
});
|
});
|
||||||
var object_fns = [
|
var object_fns = [
|
||||||
'constructor',
|
"constructor",
|
||||||
'toString',
|
"toString",
|
||||||
'valueOf',
|
"valueOf",
|
||||||
];
|
];
|
||||||
var native_fns = {
|
var native_fns = {
|
||||||
Array: makePredicate([
|
Array: makePredicate([
|
||||||
'indexOf',
|
"indexOf",
|
||||||
'join',
|
"join",
|
||||||
'lastIndexOf',
|
"lastIndexOf",
|
||||||
'slice',
|
"slice",
|
||||||
].concat(object_fns)),
|
].concat(object_fns)),
|
||||||
Boolean: makePredicate(object_fns),
|
Boolean: makePredicate(object_fns),
|
||||||
Number: makePredicate([
|
Number: makePredicate([
|
||||||
'toExponential',
|
"toExponential",
|
||||||
'toFixed',
|
"toFixed",
|
||||||
'toPrecision',
|
"toPrecision",
|
||||||
].concat(object_fns)),
|
].concat(object_fns)),
|
||||||
RegExp: makePredicate([
|
RegExp: makePredicate([
|
||||||
'test',
|
"test",
|
||||||
].concat(object_fns)),
|
].concat(object_fns)),
|
||||||
String: makePredicate([
|
String: makePredicate([
|
||||||
'charAt',
|
"charAt",
|
||||||
'charCodeAt',
|
"charCodeAt",
|
||||||
'concat',
|
"concat",
|
||||||
'indexOf',
|
"indexOf",
|
||||||
'italics',
|
"italics",
|
||||||
'lastIndexOf',
|
"lastIndexOf",
|
||||||
'match',
|
"match",
|
||||||
'replace',
|
"replace",
|
||||||
'search',
|
"search",
|
||||||
'slice',
|
"slice",
|
||||||
'split',
|
"split",
|
||||||
'substr',
|
"substr",
|
||||||
'substring',
|
"substring",
|
||||||
'trim',
|
"trim",
|
||||||
].concat(object_fns)),
|
].concat(object_fns)),
|
||||||
};
|
};
|
||||||
def(AST_Call, function(compressor){
|
def(AST_Call, function(compressor){
|
||||||
|
|||||||
Reference in New Issue
Block a user