From 0dd2c7fe243c9386414c7e2664f843259a2935c3 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sun, 9 Oct 2016 23:14:52 +0100 Subject: [PATCH] Change node: reparse JSON set value each time to avoid pass-by-ref --- nodes/core/logic/15-change.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nodes/core/logic/15-change.js b/nodes/core/logic/15-change.js index b9b823d37..6a22f2585 100644 --- a/nodes/core/logic/15-change.js +++ b/nodes/core/logic/15-change.js @@ -21,8 +21,9 @@ module.exports = function(RED) { RED.nodes.createNode(this, n); this.rules = n.rules; + var rule; if (!this.rules) { - var rule = { + rule = { t:(n.action=="replace"?"set":n.action), p:n.property||"" } @@ -39,7 +40,7 @@ module.exports = function(RED) { var valid = true; for (var i=0;i