mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Property expressions must not be blank
This commit is contained in:
parent
c989c533e8
commit
73a41707e5
@ -284,6 +284,9 @@ RED.utils = (function() {
|
|||||||
// in red/runtime/util.js
|
// in red/runtime/util.js
|
||||||
|
|
||||||
var length = str.length;
|
var length = str.length;
|
||||||
|
if (length === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
var start = 0;
|
var start = 0;
|
||||||
var inString = false;
|
var inString = false;
|
||||||
var inBox = false;
|
var inBox = false;
|
||||||
|
@ -133,6 +133,9 @@ function normalisePropertyExpression(str) {
|
|||||||
// in editor/js/ui/utils.js
|
// in editor/js/ui/utils.js
|
||||||
|
|
||||||
var length = str.length;
|
var length = str.length;
|
||||||
|
if (length === 0) {
|
||||||
|
throw new Error("Invalid property expression: zero-length");
|
||||||
|
}
|
||||||
var parts = [];
|
var parts = [];
|
||||||
var start = 0;
|
var start = 0;
|
||||||
var inString = false;
|
var inString = false;
|
||||||
|
@ -361,6 +361,7 @@ describe("red/util", function() {
|
|||||||
it("fail a[0].[1]",function() { testInvalid("a[0].[1]"); })
|
it("fail a[0].[1]",function() { testInvalid("a[0].[1]"); })
|
||||||
it("fail a['']",function() { testInvalid("a['']"); })
|
it("fail a['']",function() { testInvalid("a['']"); })
|
||||||
it("fail 'a.b'c",function() { testInvalid("'a.b'c"); })
|
it("fail 'a.b'c",function() { testInvalid("'a.b'c"); })
|
||||||
|
it("fail <blank>",function() { testInvalid("");})
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user