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:
parent
61e0e50e7b
commit
085fb283e5
@ -265,7 +265,7 @@ RED.utils = (function() {
|
|||||||
for (i=0;i<keys.length;i++) {
|
for (i=0;i<keys.length;i++) {
|
||||||
var row = $('<div class="debug-message-object-entry collapsed"></div>').appendTo(element);
|
var row = $('<div class="debug-message-object-entry collapsed"></div>').appendTo(element);
|
||||||
var newPath = path;
|
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];
|
newPath += "."+keys[i];
|
||||||
} else {
|
} else {
|
||||||
newPath += "[\""+keys[i].replace(/"/,"\\\"")+"\"]"
|
newPath += "[\""+keys[i].replace(/"/,"\\\"")+"\"]"
|
||||||
|
Loading…
Reference in New Issue
Block a user