-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Favor strictEqual * Use const where appropriate * Modernize where possible PR-URL: #8468 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
- Loading branch information
1 parent
443bede
commit 1a4207d
Showing
8 changed files
with
99 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(() => { })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); |