Skip to content

Commit ef5cb12

Browse files
TrottFishrock123
authored andcommitted
tools: fix new-parens violations
PR-URL: #8478 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 2ce364a commit ef5cb12

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

lib/internal/child_process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ function setupChannel(target, channel) {
430430
this.emit('unref');
431431
}
432432
}
433-
};
433+
}();
434434

435435
var decoder = new StringDecoder('utf8');
436436
var jsonBuffer = '';

test/parallel/test-timer-close.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require('../common');
33
var assert = require('assert');
44

5-
var t = new (process.binding('timer_wrap').Timer);
5+
var t = new (process.binding('timer_wrap').Timer)();
66
var called = 0;
77
function onclose() {
88
called++;

test/parallel/test-util-inspect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
792792
}
793793

794794
{
795-
const x = new function() {};
795+
const x = new function() {}; // eslint-disable-line new-parens
796796
assert.strictEqual(util.inspect(x), '{}');
797797
}
798798

test/parallel/test-util.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ assert.equal(false, util.isRegExp(Object.create(RegExp.prototype)));
3030
// isDate
3131
assert.equal(true, util.isDate(new Date()));
3232
assert.equal(true, util.isDate(new Date(0)));
33+
// eslint-disable-next-line new-parens
3334
assert.equal(true, util.isDate(new (context('Date'))));
3435
assert.equal(false, util.isDate(Date()));
3536
assert.equal(false, util.isDate({}));
@@ -41,9 +42,11 @@ assert.equal(false, util.isDate(Object.create(Date.prototype)));
4142
assert.equal(true, util.isError(new Error()));
4243
assert.equal(true, util.isError(new TypeError()));
4344
assert.equal(true, util.isError(new SyntaxError()));
45+
/* eslint-disable new-parens */
4446
assert.equal(true, util.isError(new (context('Error'))));
4547
assert.equal(true, util.isError(new (context('TypeError'))));
4648
assert.equal(true, util.isError(new (context('SyntaxError'))));
49+
/* eslint-enable */
4750
assert.equal(false, util.isError({}));
4851
assert.equal(false, util.isError({ name: 'Error', message: '' }));
4952
assert.equal(false, util.isError([]));

0 commit comments

Comments
 (0)