mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Make Node._flow non-enumerable to avoid circular refs
This commit is contained in:
parent
acc633b4b6
commit
54c863d48f
@ -35,7 +35,10 @@ function Node(n) {
|
|||||||
this._alias = n._alias;
|
this._alias = n._alias;
|
||||||
}
|
}
|
||||||
if (n._flow) {
|
if (n._flow) {
|
||||||
this._flow = n._flow;
|
// Make this a non-enumerable property as it may cause
|
||||||
|
// circular references. Any existing code that tries to JSON serialise
|
||||||
|
// the object (such as dashboard) will not like circular refs
|
||||||
|
Object.defineProperty(this,'_flow', {value: n._flow, })
|
||||||
}
|
}
|
||||||
this.updateWires(n.wires);
|
this.updateWires(n.wires);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user