Skip to content

Commit 3110ccf

Browse files
author
Max Leiter
authored
Merge pull request #129 from astorije/astorije/node-4
Use strict mode everywhere to make sure Node v4 is compatible with ES6 features
2 parents b1560d5 + de8b696 commit 3110ccf

24 files changed

+62
-15
lines changed

browser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/**
24
* The default irc-framework interface for browsers
35
* Usage: var IrcFramework = require('irc-framework/browser');

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/**
24
* The default irc-framework interface for nodejs
35
* Usage: var IrcFramework = require('irc-framework');

src/channel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24
var DuplexStream = require('stream').Duplex;
35

src/client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var EventEmitter = require('eventemitter3');
24
var _ = require('lodash');
35
var MiddlewareHandler = require('middleware-handler');

src/commands/command.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24

35
module.exports = IrcCommand;

src/commands/handler.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24
var EventEmitter = require('eventemitter3');
35
var irc_numerics = require('./numerics');

src/commands/handlers/channel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24
var Helpers = require('../../helpers');
35

src/commands/handlers/generics.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/*
24
35
Generic IRC events. Simply passing selected IRC params into javascript objects

src/commands/handlers/messaging.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24
var util = require('util');
35

src/commands/handlers/misc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24

35
var handlers = {
@@ -204,7 +206,7 @@ module.exports = function AddCommandHandlers(command_controller) {
204206
function getChanListCache(that) {
205207
var cache = that.cache('chanlist');
206208

207-
// fix some IRC networks
209+
// fix some IRC networks
208210
if (!cache.channels) {
209211
cache.channels = [];
210212
}

src/commands/handlers/registration.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24

35
var handlers = {

src/commands/handlers/user.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24

35
var handlers = {

src/commands/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
'use strict';
2+
13
module.exports.Command = require('./command');
24
module.exports.CommandHandler = require('./handler');

src/commands/numerics.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
module.exports = {
24
'001': 'RPL_WELCOME',
35
'002': 'RPL_YOURHOST',

src/connection.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var EventEmitter = require('eventemitter3');
24
var _ = require('lodash');
35
var ircLineParser = require('./irclineparser');
@@ -174,27 +176,27 @@ Connection.prototype.setTimeout = function(/*fn, length, argN */) {
174176
var tmr = null;
175177
var args = Array.prototype.slice.call(arguments, 0);
176178
var callback = args[0];
177-
179+
178180
args[0] = function() {
179181
_.pull(that._timers, tmr);
180182
callback.apply(null, args);
181183
};
182-
184+
183185
tmr = setTimeout.apply(null, args);
184186
this._timers.push(tmr);
185187
return tmr;
186188
};
187189

188190
Connection.prototype.clearTimeout = function(tmr) {
189191
clearTimeout(tmr);
190-
_.pull(this._timers, tmr);
192+
_.pull(this._timers, tmr);
191193
};
192194

193195
Connection.prototype.clearTimers = function() {
194196
this._timers.forEach(function(tmr) {
195197
clearTimeout(tmr);
196198
});
197-
199+
198200
this._timers = [];
199201
};
200202

src/irclineparser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var _ = require('lodash');
24

35
module.exports = parseIrcLine;

src/networkinfo.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
module.exports = NetworkInfo;
24

35
function NetworkInfo() {

src/transports/net.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/**
24
* TCP / TLS transport
35
*/

src/transports/websocket.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/**
24
* Websocket transport
35
*/

src/user.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
function User(opts) {
24
opts = opts || {};
35

test/commands/handlers/misc.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/*globals describe, it */
24
/* jshint -W024 */
35
/* jshint expr:true */

test/helper.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
"use strict";
1+
'use strict';
2+
23
/*globals describe, it */
34
let chai = require('chai'),
45
Helper = require('../src/helpers'),

test/ircLineParser.test.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/*globals describe, it */
24
var chai = require('chai'),
35
parseIrcLine = require('../src/irclineparser'),
@@ -111,7 +113,7 @@ describe('src/irclineparser.js', function () {
111113
command: 'TEST'
112114
});
113115
});
114-
116+
115117

116118
it('should parse a command with a single parameter and a nick@hostname prefix', function () {
117119
var msgObj = parseIrcLine(':nick@example.org TEST foo');
@@ -279,7 +281,7 @@ describe('src/irclineparser.js', function () {
279281
command: 'TEST'
280282
});
281283
});
282-
284+
283285
it('should parse a message that has a tag with a value', function () {
284286
var msgObj = parseIrcLine('@foo=bar TEST');
285287

@@ -339,7 +341,7 @@ describe('src/irclineparser.js', function () {
339341
hostname: 'example.org'
340342
});
341343
});
342-
344+
343345
it('should parse a message that has a tag with no value and a nick!ident@hostname prefix', function () {
344346
var msgObj = parseIrcLine('@foo :nick!ident@example.org TEST');
345347

@@ -650,7 +652,7 @@ describe('src/irclineparser.js', function () {
650652
params: ['bar', 'baz']
651653
});
652654
});
653-
655+
654656
it('should parse a message that has a tag with no value, a "trailing" parameter that has spaces and a nick@hostname prefix', function () {
655657
var msgObj = parseIrcLine('@foo :nick@example.org TEST :hello world');
656658

@@ -754,7 +756,7 @@ describe('src/irclineparser.js', function () {
754756
params: ['bar', 'baz']
755757
});
756758
});
757-
759+
758760
it('should parse a message that has a tag with no value, a "trailing" parameter that has spaces and a nick!ident@hostname prefix', function () {
759761
var msgObj = parseIrcLine('@foo :nick!ident@example.org TEST :hello world');
760762

@@ -1047,7 +1049,7 @@ describe('src/irclineparser.js', function () {
10471049
params: ['bar', 'baz']
10481050
});
10491051
});
1050-
1052+
10511053
it('should parse a message that has a tag with a value, a "trailing" parameter that has spaces and a nick!ident@hostname prefix', function () {
10521054
var msgObj = parseIrcLine('@foo=testvalue :nick!ident@example.org TEST :hello world');
10531055

@@ -1360,7 +1362,7 @@ describe('src/irclineparser.js', function () {
13601362
params: ['bar', 'baz']
13611363
});
13621364
});
1363-
1365+
13641366
it('should parse a message that has multiple tags with no values, a "trailing" parameter that has spaces and a nick!ident@hostname prefix', function () {
13651367
var msgObj = parseIrcLine('@foo;bar :nick!ident@example.org TEST :hello world');
13661368

@@ -1564,7 +1566,7 @@ describe('src/irclineparser.js', function () {
15641566
params: ['bar', 'baz']
15651567
});
15661568
});
1567-
1569+
15681570
it('should parse a message that has multiple tags one with a value, a "trailing" parameter that has spaces and a nick@hostname prefix', function () {
15691571
var msgObj = parseIrcLine('@foo=bar;baz :nick@example.org TEST :hello world');
15701572

@@ -1675,7 +1677,7 @@ describe('src/irclineparser.js', function () {
16751677
params: ['bar', 'baz']
16761678
});
16771679
});
1678-
1680+
16791681
it('should parse a message that has multiple tags one with a value, a "trailing" parameter that has spaces and a nick!ident@hostname prefix', function () {
16801682
var msgObj = parseIrcLine('@foo=bar;baz :nick!ident@example.org TEST :hello world');
16811683

test/mocks.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var sinon = require('sinon'),
24
_ = require('lodash');
35

0 commit comments

Comments
 (0)