1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix test for valid js identifiers in debug path construction

This commit is contained in:
Nick O'Leary 2017-05-10 16:25:46 +01:00
parent 61e0e50e7b
commit 085fb283e5
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -265,7 +265,7 @@ RED.utils = (function() {
for (i=0;i<keys.length;i++) {
var row = $('<div class="debug-message-object-entry collapsed"></div>').appendTo(element);
var newPath = path;
if (/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(keys[i])) {
if (/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(keys[i])) {
newPath += "."+keys[i];
} else {
newPath += "[\""+keys[i].replace(/"/,"\\\"")+"\"]"