mirror of https://github.com/lukechilds/node.git
Browse Source
* Favor strictEqual * Use const where appropriate * Modernize where possible PR-URL: https://github.com/nodejs/node/pull/8468 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>v7.x
James M Snell
8 years ago
8 changed files with 99 additions and 138 deletions
@ -1,6 +1,6 @@ |
|||
'use strict'; |
|||
var common = require('../common'); |
|||
var dns = require('dns'); |
|||
const common = require('../common'); |
|||
const dns = require('dns'); |
|||
|
|||
// Should not segfault, see #6244.
|
|||
dns.resolve4('127.0.0.1', common.mustCall(function() { })); |
|||
dns.resolve4('127.0.0.1', common.mustCall(() => { })); |
|||
|
@ -1,8 +1,8 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
var assert = require('assert'); |
|||
var dns = require('dns'); |
|||
const assert = require('assert'); |
|||
const dns = require('dns'); |
|||
|
|||
// Should not raise assertion error. Issue #7070
|
|||
assert.throws(function() { dns.resolveNs([]); }); // bad name
|
|||
assert.throws(function() { dns.resolveNs(''); }); // bad callback
|
|||
assert.throws(() => dns.resolveNs([])); // bad name
|
|||
assert.throws(() => dns.resolveNs('')); // bad callback
|
|||
|
@ -1,12 +1,12 @@ |
|||
'use strict'; |
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
var spawn = require('child_process').spawn; |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
const spawn = require('child_process').spawn; |
|||
|
|||
var options = { |
|||
const options = { |
|||
cwd: common.fixturesDir |
|||
}; |
|||
var child = spawn(process.execPath, ['-e', 'require("foo")'], options); |
|||
child.on('exit', function(code) { |
|||
assert.equal(code, 0); |
|||
}); |
|||
const child = spawn(process.execPath, ['-e', 'require("foo")'], options); |
|||
child.on('exit', common.mustCall((code) => { |
|||
assert.strictEqual(code, 0); |
|||
})); |
|||
|
@ -1,22 +1,23 @@ |
|||
/* eslint-disable strict */ |
|||
var common = require('../common'); |
|||
var path = require('path'); |
|||
var assert = require('assert'); |
|||
const common = require('../common'); |
|||
const path = require('path'); |
|||
const assert = require('assert'); |
|||
|
|||
common.globalCheck = false; |
|||
|
|||
baseFoo = 'foo'; // eslint-disable-line no-undef
|
|||
global.baseBar = 'bar'; |
|||
|
|||
assert.equal('foo', global.baseFoo, 'x -> global.x in base level not working'); |
|||
assert.strictEqual('foo', global.baseFoo, |
|||
'x -> global.x in base level not working'); |
|||
|
|||
assert.equal('bar', |
|||
baseBar, // eslint-disable-line no-undef
|
|||
'global.x -> x in base level not working'); |
|||
assert.strictEqual('bar', |
|||
baseBar, // eslint-disable-line no-undef
|
|||
'global.x -> x in base level not working'); |
|||
|
|||
var module = require(path.join(common.fixturesDir, 'global', 'plain')); |
|||
const fooBar = module.fooBar; |
|||
|
|||
assert.equal('foo', fooBar.foo, 'x -> global.x in sub level not working'); |
|||
assert.strictEqual('foo', fooBar.foo, 'x -> global.x in sub level not working'); |
|||
|
|||
assert.equal('bar', fooBar.bar, 'global.x -> x in sub level not working'); |
|||
assert.strictEqual('bar', fooBar.bar, 'global.x -> x in sub level not working'); |
|||
|
Loading…
Reference in new issue