From 2cdaed1325a66a367d328cb3cff75f1d7f9122e8 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Thu, 29 May 2014 22:13:21 +0100 Subject: [PATCH] Add "use strict" to most core nodes. (skipping ones that may have other work in progress) --- nodes/core/analysis/72-sentiment.js | 5 ++-- nodes/core/core/80-template.js | 1 + nodes/core/core/90-comment.js | 1 + nodes/core/core/98-unknown.js | 1 + nodes/core/hardware/36-rpi-gpio.js | 1 + nodes/core/io/10-mqtt.html | 7 +++-- nodes/core/io/22-websocket.js | 46 ++++++++++++++--------------- nodes/core/io/23-watch.js | 7 +++-- nodes/core/io/32-udp.js | 31 +++++++++---------- nodes/core/logic/10-switch.js | 7 +++-- nodes/core/logic/15-change.js | 3 +- nodes/core/logic/16-range.js | 3 +- nodes/core/parsers/70-CSV.js | 1 + nodes/core/parsers/70-JSON.js | 3 +- nodes/core/parsers/70-XML.js | 3 +- nodes/core/social/32-feedparse.js | 12 ++++---- nodes/core/social/61-email.js | 1 + nodes/core/social/91-irc.js | 19 ++++++------ nodes/core/storage/28-tail.js | 13 ++++---- nodes/core/storage/50-file.js | 13 ++++---- nodes/core/storage/66-mongodb.html | 7 +++-- nodes/core/storage/66-mongodb.js | 42 ++++++++++++++++---------- 22 files changed, 128 insertions(+), 99 deletions(-) diff --git a/nodes/core/analysis/72-sentiment.js b/nodes/core/analysis/72-sentiment.js index 16a4d7ea2..747e079cc 100644 --- a/nodes/core/analysis/72-sentiment.js +++ b/nodes/core/analysis/72-sentiment.js @@ -15,12 +15,13 @@ **/ module.exports = function(RED) { + "use strict"; var sentiment = require('sentiment'); - + function SentimentNode(n) { RED.nodes.createNode(this,n); var node = this; - + this.on("input", function(msg) { sentiment(msg.payload, msg.overrides || null, function (err, result) { msg.sentiment = result; diff --git a/nodes/core/core/80-template.js b/nodes/core/core/80-template.js index aafb893e4..82348326e 100644 --- a/nodes/core/core/80-template.js +++ b/nodes/core/core/80-template.js @@ -15,6 +15,7 @@ **/ module.exports = function(RED) { + "use strict"; var mustache = require("mustache"); var util = require("util"); var fs = require('fs'); diff --git a/nodes/core/core/90-comment.js b/nodes/core/core/90-comment.js index 759b16207..ef5f08005 100644 --- a/nodes/core/core/90-comment.js +++ b/nodes/core/core/90-comment.js @@ -15,6 +15,7 @@ **/ module.exports = function(RED) { + "use strict"; function CommentNode(n) { RED.nodes.createNode(this,n); } diff --git a/nodes/core/core/98-unknown.js b/nodes/core/core/98-unknown.js index 1a7362263..ed4716b86 100644 --- a/nodes/core/core/98-unknown.js +++ b/nodes/core/core/98-unknown.js @@ -15,6 +15,7 @@ **/ module.exports = function(RED) { + "use strict"; function UnknownNode(n) { RED.nodes.createNode(this,n); } diff --git a/nodes/core/hardware/36-rpi-gpio.js b/nodes/core/hardware/36-rpi-gpio.js index d7378c870..99e36da53 100644 --- a/nodes/core/hardware/36-rpi-gpio.js +++ b/nodes/core/hardware/36-rpi-gpio.js @@ -15,6 +15,7 @@ **/ module.exports = function(RED) { + "use strict"; var util = require("util"); var exec = require('child_process').exec; var fs = require('fs'); diff --git a/nodes/core/io/10-mqtt.html b/nodes/core/io/10-mqtt.html index e4d6c985d..3ad7f3239 100644 --- a/nodes/core/io/10-mqtt.html +++ b/nodes/core/io/10-mqtt.html @@ -102,7 +102,7 @@