add a test for zero-length string in is_identifier_string, which is used in property compression. Also added a test exercising the change.
This commit is contained in:
parent
0f509f8336
commit
d3655cd07f
|
|
@ -172,7 +172,7 @@ function is_identifier_string(str){
|
|||
if (!is_identifier_char(str.charAt(i)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return str.length > 0;
|
||||
};
|
||||
|
||||
function parse_js_number(num) {
|
||||
|
|
|
|||
|
|
@ -19,12 +19,14 @@ dot_properties: {
|
|||
a["if"] = "if";
|
||||
a["*"] = "asterisk";
|
||||
a["\u0EB3"] = "unicode";
|
||||
a[""] = "whitespace";
|
||||
}
|
||||
expect: {
|
||||
a.foo = "bar";
|
||||
a["if"] = "if";
|
||||
a["*"] = "asterisk";
|
||||
a.\u0EB3 = "unicode";
|
||||
a[""] = "whitespace";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -38,11 +40,13 @@ dot_properties_es5: {
|
|||
a["if"] = "if";
|
||||
a["*"] = "asterisk";
|
||||
a["\u0EB3"] = "unicode";
|
||||
a[""] = "whitespace";
|
||||
}
|
||||
expect: {
|
||||
a.foo = "bar";
|
||||
a.if = "if";
|
||||
a["*"] = "asterisk";
|
||||
a.\u0EB3 = "unicode";
|
||||
a[""] = "whitespace";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user