aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorJustin Lau <justin@tclau.com>2013-05-05 22:27:43 +0800
committerJustin Lau <justin@tclau.com>2013-05-05 22:27:43 +0800
commit1e3bc0caa0a8ad8c3bcab07d539ee153ea8e96b3 (patch)
treeb24e36a3ddc4d9a0415cb11481006c803c682f27 /lib/compress.js
parent8227e8795b309b46e0f2ef998d7238198eb07425 (diff)
downloadtracifyjs-1e3bc0caa0a8ad8c3bcab07d539ee153ea8e96b3.tar.gz
tracifyjs-1e3bc0caa0a8ad8c3bcab07d539ee153ea8e96b3.zip
Fixed dot property issue with invlid identifier names.
Signed-off-by: Justin Lau <justin@tclau.com>
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js3
1 files changed, 2 insertions, 1 deletions
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