Merge pull request #308 from meteor/fix-unicode-keys

Only allow identifier start characters at the beginning of identifiers.
This commit is contained in:
Mihai Bazon 2013-10-04 00:13:52 -07:00
commit 253c7c2325

View File

@ -170,7 +170,7 @@ function is_identifier_char(ch) {
function is_identifier_string(str){
var i = str.length;
if (i == 0) return false;
if (is_digit(str.charCodeAt(0))) return false;
if (!is_identifier_start(str.charCodeAt(0))) return false;
while (--i >= 0) {
if (!is_identifier_char(str.charAt(i)))
return false;