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'; |
'use strict'; |
||||
var common = require('../common'); |
const common = require('../common'); |
||||
var dns = require('dns'); |
const dns = require('dns'); |
||||
|
|
||||
// Should not segfault, see #6244.
|
// 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'; |
'use strict'; |
||||
require('../common'); |
require('../common'); |
||||
var assert = require('assert'); |
const assert = require('assert'); |
||||
var dns = require('dns'); |
const dns = require('dns'); |
||||
|
|
||||
// Should not raise assertion error. Issue #7070
|
// Should not raise assertion error. Issue #7070
|
||||
assert.throws(function() { dns.resolveNs([]); }); // bad name
|
assert.throws(() => dns.resolveNs([])); // bad name
|
||||
assert.throws(function() { dns.resolveNs(''); }); // bad callback
|
assert.throws(() => dns.resolveNs('')); // bad callback
|
||||
|
@ -1,12 +1,12 @@ |
|||||
'use strict'; |
'use strict'; |
||||
var common = require('../common'); |
const common = require('../common'); |
||||
var assert = require('assert'); |
const assert = require('assert'); |
||||
var spawn = require('child_process').spawn; |
const spawn = require('child_process').spawn; |
||||
|
|
||||
var options = { |
const options = { |
||||
cwd: common.fixturesDir |
cwd: common.fixturesDir |
||||
}; |
}; |
||||
var child = spawn(process.execPath, ['-e', 'require("foo")'], options); |
const child = spawn(process.execPath, ['-e', 'require("foo")'], options); |
||||
child.on('exit', function(code) { |
child.on('exit', common.mustCall((code) => { |
||||
assert.equal(code, 0); |
assert.strictEqual(code, 0); |
||||
}); |
})); |
||||
|
@ -1,22 +1,23 @@ |
|||||
/* eslint-disable strict */ |
/* eslint-disable strict */ |
||||
var common = require('../common'); |
const common = require('../common'); |
||||
var path = require('path'); |
const path = require('path'); |
||||
var assert = require('assert'); |
const assert = require('assert'); |
||||
|
|
||||
common.globalCheck = false; |
common.globalCheck = false; |
||||
|
|
||||
baseFoo = 'foo'; // eslint-disable-line no-undef
|
baseFoo = 'foo'; // eslint-disable-line no-undef
|
||||
global.baseBar = 'bar'; |
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', |
assert.strictEqual('bar', |
||||
baseBar, // eslint-disable-line no-undef
|
baseBar, // eslint-disable-line no-undef
|
||||
'global.x -> x in base level not working'); |
'global.x -> x in base level not working'); |
||||
|
|
||||
var module = require(path.join(common.fixturesDir, 'global', 'plain')); |
var module = require(path.join(common.fixturesDir, 'global', 'plain')); |
||||
const fooBar = module.fooBar; |
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