Make Node._flow non-enumerable to avoid circular refs

This commit is contained in:
Nick O'Leary 2019-01-21 14:19:19 +00:00
parent acc633b4b6
commit 54c863d48f
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,10 @@ function Node(n) {
this._alias = n._alias;
}
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);
}