Skip to content

Commit

Permalink
tools: fix new-parens violations
Browse files Browse the repository at this point in the history
PR-URL: #8478
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and Fishrock123 committed Sep 14, 2016
1 parent 2ce364a commit ef5cb12
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function setupChannel(target, channel) {
this.emit('unref');
}
}
};
}();

var decoder = new StringDecoder('utf8');
var jsonBuffer = '';
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-timer-close.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require('../common');
var assert = require('assert');

var t = new (process.binding('timer_wrap').Timer);
var t = new (process.binding('timer_wrap').Timer)();
var called = 0;
function onclose() {
called++;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
}

{
const x = new function() {};
const x = new function() {}; // eslint-disable-line new-parens
assert.strictEqual(util.inspect(x), '{}');
}

Expand Down
3 changes: 3 additions & 0 deletions test/parallel/test-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ assert.equal(false, util.isRegExp(Object.create(RegExp.prototype)));
// isDate
assert.equal(true, util.isDate(new Date()));
assert.equal(true, util.isDate(new Date(0)));
// eslint-disable-next-line new-parens
assert.equal(true, util.isDate(new (context('Date'))));
assert.equal(false, util.isDate(Date()));
assert.equal(false, util.isDate({}));
Expand All @@ -41,9 +42,11 @@ assert.equal(false, util.isDate(Object.create(Date.prototype)));
assert.equal(true, util.isError(new Error()));
assert.equal(true, util.isError(new TypeError()));
assert.equal(true, util.isError(new SyntaxError()));
/* eslint-disable new-parens */
assert.equal(true, util.isError(new (context('Error'))));
assert.equal(true, util.isError(new (context('TypeError'))));
assert.equal(true, util.isError(new (context('SyntaxError'))));
/* eslint-enable */
assert.equal(false, util.isError({}));
assert.equal(false, util.isError({ name: 'Error', message: '' }));
assert.equal(false, util.isError([]));
Expand Down

0 comments on commit ef5cb12

Please sign in to comment.