[Pkg-javascript-commits] [uglifyjs] 14/26: Turn foo.new into foo["new"] when not --screw-ie8. Fix #534

Jonas Smedegaard dr at jones.dk
Tue May 19 00:02:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag v2.4.16
in repository uglifyjs.

commit 4c64554808e0805b86893704dc87df9ec449961a
Author: Mihai Bazon <mihai at bazon.net>
Date:   Tue Aug 26 10:11:01 2014 +0300

    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 1e99f15..b55361b 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];
     });
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list