From 54c863d48f10c5912456b09d2a5e7abcad1096b4 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 21 Jan 2019 14:19:19 +0000 Subject: [PATCH] Make Node._flow non-enumerable to avoid circular refs --- packages/node_modules/@node-red/runtime/lib/nodes/Node.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/runtime/lib/nodes/Node.js b/packages/node_modules/@node-red/runtime/lib/nodes/Node.js index 132709372..a0825f7b1 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/Node.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/Node.js @@ -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); }