From: Mihai Bazon Date: Tue, 26 Aug 2014 07:11:01 +0000 (+0300) Subject: Turn foo.new into foo["new"] when not --screw-ie8. Fix #534 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4c64554808e0805b86893704dc87df9ec449961a;p=UglifyJS.git Turn foo.new into foo["new"] when not --screw-ie8. Fix #534 --- diff --git a/lib/compress.js b/lib/compress.js index 1e99f158..b55361b3 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2371,6 +2371,15 @@ merge(Compressor.prototype, { }); 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]; });