mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Tidy up merge commit of validatePropertyExpression
This commit is contained in:
parent
f973396821
commit
4c6157a06e
@ -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;
|
||||
|
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user