From 77f6652fa9381d9e3329aa78c6250d586a7f38a4 Mon Sep 17 00:00:00 2001 From: Mark Hindess Date: Wed, 16 Jul 2014 21:39:17 +0100 Subject: [PATCH 1/2] Remove spurious variable declaration. --- nodes/core/io/10-mqtt.js | 1 - 1 file changed, 1 deletion(-) diff --git a/nodes/core/io/10-mqtt.js b/nodes/core/io/10-mqtt.js index 737dd39aa..c4e9f57d3 100644 --- a/nodes/core/io/10-mqtt.js +++ b/nodes/core/io/10-mqtt.js @@ -77,7 +77,6 @@ module.exports = function(RED) { this.topic = n.topic; this.broker = n.broker; this.brokerConfig = RED.nodes.getNode(this.broker); - var node = this; if (this.brokerConfig) { this.status({fill:"red",shape:"ring",text:"disconnected"}); this.client = connectionPool.get(this.brokerConfig.broker,this.brokerConfig.port,this.brokerConfig.clientid,this.brokerConfig.username,this.brokerConfig.password); From 5073cf8dd70ef5ff02a94a075b5eb991607507e3 Mon Sep 17 00:00:00 2001 From: Mark Hindess Date: Wed, 16 Jul 2014 21:43:27 +0100 Subject: [PATCH 2/2] Reduce scope of variable declaration to be consistent with MQTTInNode code. --- nodes/core/io/10-mqtt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes/core/io/10-mqtt.js b/nodes/core/io/10-mqtt.js index c4e9f57d3..a01952940 100644 --- a/nodes/core/io/10-mqtt.js +++ b/nodes/core/io/10-mqtt.js @@ -116,7 +116,6 @@ module.exports = function(RED) { this.broker = n.broker; this.brokerConfig = RED.nodes.getNode(this.broker); - var node = this; if (this.brokerConfig) { this.status({fill:"red",shape:"ring",text:"disconnected"},true); @@ -129,6 +128,7 @@ module.exports = function(RED) { this.client.publish(msg); } }); + var node = this; this.client.on("connectionlost",function() { node.status({fill:"red",shape:"ring",text:"disconnected"}); });