Fixed dot properties not optimizing unicode identifiers. Signed-off-by: Justin Lau <justin@tclau.com>

This commit is contained in:
Justin Lau
2013-05-06 02:45:41 +08:00
committed by Mihai Bazon
parent fcd544cc10
commit 9af2bbffde
2 changed files with 10 additions and 2 deletions

View File

@@ -1962,8 +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") && /^[a-z_$][a-z0-9_$]*$/i.test(prop))) {
if (compressor.option("screw_ie8") && RESERVED_WORDS(prop)
|| !(RESERVED_WORDS(prop)) && is_identifier_string(prop)) {
return make_node(AST_Dot, self, {
expression : self.expression,
property : prop