Handle more edge cases with RED.util.normalisePropertyExpression

This commit is contained in:
Nick O'Leary
2016-06-13 21:59:20 +01:00
parent 8fb1c76247
commit 08ade44dc8
3 changed files with 11 additions and 1 deletions

View File

@@ -146,6 +146,9 @@ function normalisePropertyExpression(str) {
quoteChar = c;
start = i+1;
} else if (c === '.') {
if (i===0) {
throw new Error("Invalid property expression: unexpected . at position 0");
}
if (start != i) {
v = str.substring(start,i);
if (/^\d+$/.test(v)) {
@@ -192,6 +195,8 @@ function normalisePropertyExpression(str) {
}
start = i+1;
inBox = false;
} else if (c === ' ') {
throw new Error("Invalid property expression: unexpected ' ' at position "+i);
}
} else {
if (c === quoteChar) {