Turn foo.new into foo["new"] when not --screw-ie8. Fix #534
This commit is contained in:
@@ -2371,6 +2371,15 @@ merge(Compressor.prototype, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
OPT(AST_Dot, function(self, compressor){
|
OPT(AST_Dot, function(self, compressor){
|
||||||
|
var prop = self.property;
|
||||||
|
if (RESERVED_WORDS(prop) && !compressor.option("screw_ie8")) {
|
||||||
|
return make_node(AST_Sub, self, {
|
||||||
|
expression : self.expression,
|
||||||
|
property : make_node(AST_String, self, {
|
||||||
|
value: prop
|
||||||
|
})
|
||||||
|
}).optimize(compressor);
|
||||||
|
}
|
||||||
return self.evaluate(compressor)[0];
|
return self.evaluate(compressor)[0];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user