Merge pull request #308 from meteor/fix-unicode-keys
Only allow identifier start characters at the beginning of identifiers.
This commit is contained in:
commit
253c7c2325
|
|
@ -170,7 +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;
|
if (!is_identifier_start(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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user