@@ -1965,8 +1965,8 @@ merge(Compressor.prototype, {
|
|||||||
var prop = self.property;
|
var prop = self.property;
|
||||||
if (prop instanceof AST_String && compressor.option("properties")) {
|
if (prop instanceof AST_String && compressor.option("properties")) {
|
||||||
prop = prop.getValue();
|
prop = prop.getValue();
|
||||||
if (compressor.option("screw_ie8") && RESERVED_WORDS(prop)
|
if ((compressor.option("screw_ie8") && RESERVED_WORDS(prop))
|
||||||
|| !(RESERVED_WORDS(prop)) && is_identifier_string(prop)) {
|
|| (!(RESERVED_WORDS(prop)) && is_identifier_string(prop))) {
|
||||||
return make_node(AST_Dot, self, {
|
return make_node(AST_Dot, self, {
|
||||||
expression : self.expression,
|
expression : self.expression,
|
||||||
property : prop
|
property : prop
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ function is_identifier_char(ch) {
|
|||||||
function is_identifier_string(str){
|
function is_identifier_string(str){
|
||||||
var i = str.length;
|
var i = str.length;
|
||||||
if (i == 0) return false;
|
if (i == 0) return false;
|
||||||
|
if (is_digit(str.charCodeAt(0))) return false;
|
||||||
while (--i >= 0) {
|
while (--i >= 0) {
|
||||||
if (!is_identifier_char(str.charAt(i)))
|
if (!is_identifier_char(str.charAt(i)))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ dot_properties: {
|
|||||||
a["*"] = "asterisk";
|
a["*"] = "asterisk";
|
||||||
a["\u0EB3"] = "unicode";
|
a["\u0EB3"] = "unicode";
|
||||||
a[""] = "whitespace";
|
a[""] = "whitespace";
|
||||||
|
a["1_1"] = "foo";
|
||||||
}
|
}
|
||||||
expect: {
|
expect: {
|
||||||
a.foo = "bar";
|
a.foo = "bar";
|
||||||
@@ -27,6 +28,7 @@ dot_properties: {
|
|||||||
a["*"] = "asterisk";
|
a["*"] = "asterisk";
|
||||||
a.\u0EB3 = "unicode";
|
a.\u0EB3 = "unicode";
|
||||||
a[""] = "whitespace";
|
a[""] = "whitespace";
|
||||||
|
a["1_1"] = "foo";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user