mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Make Node._flow a writeable property
This is needed so an existing node constructor that does: Object.assign(this,config); works when it tries to replace this._flow with config._flow.
This commit is contained in:
parent
d534a8952d
commit
85de227003
@ -38,7 +38,11 @@ function Node(n) {
|
||||
// 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, })
|
||||
// The value must still be writable in the case that a node does:
|
||||
// Object.assign(this,config)
|
||||
// as part of its constructure - config._flow will overwrite this._flow
|
||||
// which we can tolerate as they are the same object.
|
||||
Object.defineProperty(this,'_flow', {value: n._flow, enumerable: false, writable: true })
|
||||
}
|
||||
this.updateWires(n.wires);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user