Tidy up merge commit of validatePropertyExpression

This commit is contained in:
Nick O'Leary 2017-01-06 14:32:37 +00:00
parent f973396821
commit 4c6157a06e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 3 additions and 3 deletions

View File

@ -303,8 +303,8 @@ RED.utils = (function() {
if (i===0 || i===length-1) {
return false;
}
// Next char is a-z
if (!/[a-z0-9]/i.test(str[i+1])) {
// Next char is first char of an identifier: a-z 0-9 $ _
if (!/[a-z0-9\$\_]/i.test(str[i+1])) {
return false;
}
start = i+1;

View File

@ -164,7 +164,7 @@ function normalisePropertyExpression(str) {
if (i===length-1) {
throw new Error("Invalid property expression: unterminated expression");
}
// Next char is a-z
// Next char is first char of an identifier: a-z 0-9 $ _
if (!/[a-z0-9\$\_]/i.test(str[i+1])) {
throw new Error("Invalid property expression: unexpected "+str[i+1]+" at position "+(i+1));
}