From 1e3bc0caa0a8ad8c3bcab07d539ee153ea8e96b3 Mon Sep 17 00:00:00 2001 From: Justin Lau Date: Sun, 5 May 2013 22:27:43 +0800 Subject: [PATCH] Fixed dot property issue with invlid identifier names. Signed-off-by: Justin Lau --- lib/compress.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/compress.js b/lib/compress.js index ebd3dd7a..623fe45e 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1962,7 +1962,8 @@ merge(Compressor.prototype, { var prop = self.property; if (prop instanceof AST_String && compressor.option("properties")) { prop = prop.getValue(); - if (is_identifier(prop) || compressor.option("screw_ie8")) { + if (is_identifier(prop) + || (compressor.option("screw_ie8") && /^[a-z_$][a-z0-9_$]*$/i.test(prop))) { return make_node(AST_Dot, self, { expression : self.expression, property : prop -- 2.34.1