diff --git a/nodes/core/analysis/72-sentiment.html b/nodes/core/analysis/72-sentiment.html index 5f2dd1889..6d068075a 100644 --- a/nodes/core/analysis/72-sentiment.html +++ b/nodes/core/analysis/72-sentiment.html @@ -24,10 +24,10 @@ diff --git a/nodes/core/analysis/72-sentiment.js b/nodes/core/analysis/72-sentiment.js index 4345900b7..6a763b70f 100644 --- a/nodes/core/analysis/72-sentiment.js +++ b/nodes/core/analysis/72-sentiment.js @@ -19,14 +19,13 @@ var sentiment = require('sentiment'); function SentimentNode(n) { RED.nodes.createNode(this,n); + var node = this; this.on("input", function(msg) { - var node = this; - sentiment(msg.payload, function (err, result) { - msg.sentiment = result; - node.send(msg); - }); + sentiment(msg.payload, function (err, result) { + msg.sentiment = result; + node.send(msg); + }); }); } - RED.nodes.registerType("sentiment",SentimentNode);