From 4c64554808e0805b86893704dc87df9ec449961a Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Tue, 26 Aug 2014 10:11:01 +0300 Subject: [PATCH] Turn foo.new into foo["new"] when not --screw-ie8. Fix #534 --- lib/compress.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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]; }); -- 2.34.1