mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Clone default node properties to avoid reference leakage
This commit is contained in:
parent
9d4d1acf2d
commit
8608d010b8
@ -773,7 +773,7 @@ RED.editor = (function() {
|
|||||||
}
|
}
|
||||||
for (var d in node_def.defaults) {
|
for (var d in node_def.defaults) {
|
||||||
if (node_def.defaults[d].value) {
|
if (node_def.defaults[d].value) {
|
||||||
editing_config_node[d] = node_def.defaults[d].value;
|
editing_config_node[d] = JSON.parse(JSON.stringify(node_def.defaults[d].value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
editing_config_node["_"] = node_def._;
|
editing_config_node["_"] = node_def._;
|
||||||
|
@ -345,7 +345,9 @@ RED.view = (function() {
|
|||||||
|
|
||||||
for (var d in nn._def.defaults) {
|
for (var d in nn._def.defaults) {
|
||||||
if (nn._def.defaults.hasOwnProperty(d)) {
|
if (nn._def.defaults.hasOwnProperty(d)) {
|
||||||
nn[d] = nn._def.defaults[d].value;
|
if (nn._def.defaults[d].value !== undefined) {
|
||||||
|
nn[d] = JSON.parse(JSON.stringify(nn._def.defaults[d].value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user