Browse Source

tools: fix new-parens violations

PR-URL: https://github.com/nodejs/node/pull/8478
Reviewed-By: James M Snell <jasnell@gmail.com>
v7.x
Rich Trott 8 years ago
parent
commit
a6b1f175c2
  1. 2
      lib/internal/child_process.js
  2. 2
      test/parallel/test-timer-close.js
  3. 2
      test/parallel/test-util-inspect.js
  4. 3
      test/parallel/test-util.js

2
lib/internal/child_process.js

@ -430,7 +430,7 @@ function setupChannel(target, channel) {
this.emit('unref');
}
}
};
}();
var decoder = new StringDecoder('utf8');
var jsonBuffer = '';

2
test/parallel/test-timer-close.js

@ -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++;

2
test/parallel/test-util-inspect.js

@ -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), '{}');
}

3
test/parallel/test-util.js

@ -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({}));
@ -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([]));

Loading…
Cancel
Save