if (d && d.constant && d.init) return ev(d.init, compressor);
throw def;
});
+ def(AST_Dot, function(compressor){
+ if (compressor.option("unsafe") && this.property == "length") {
+ var str = ev(this.expression, compressor);
+ if (typeof str == "string")
+ return str.length;
+ }
+ throw def;
+ });
})(function(node, func){
node.DEFMETHOD("_eval", func);
});
return make_node(AST_Dot, self, {
expression : self.expression,
property : prop
- });
+ }).optimize(compressor);
}
var v = parseFloat(prop);
if (!isNaN(v) && v.toString() == prop) {
return self;
});
+ OPT(AST_Dot, function(self, compressor){
+ return self.evaluate(compressor)[0];
+ });
+
function literals_in_boolean_context(self, compressor) {
if (compressor.option("booleans") && compressor.in_boolean_context()) {
return make_node(AST_True, self);