src,test,tools: modify for more stringent linting
ESLint 2.1.0 is coming. Some lint rules have been tightened. PR-URL: https://github.com/nodejs/node/pull/5214 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Myles Borins <myles.borins@gmail.com>
This commit is contained in:
parent
7d1d3a6621
commit
32f6098eef
@ -27,7 +27,7 @@
|
|||||||
get() {
|
get() {
|
||||||
const internalUtil = NativeModule.require('internal/util');
|
const internalUtil = NativeModule.require('internal/util');
|
||||||
eeWarned = internalUtil.printDeprecationMessage(
|
eeWarned = internalUtil.printDeprecationMessage(
|
||||||
`process.EventEmitter is deprecated. Use require('events') instead.`,
|
"process.EventEmitter is deprecated. Use require('events') instead.",
|
||||||
eeWarned
|
eeWarned
|
||||||
);
|
);
|
||||||
return EventEmitter;
|
return EventEmitter;
|
||||||
|
@ -4,6 +4,6 @@ const common = require('../common');
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const spawnSync = require('child_process').spawnSync;
|
const spawnSync = require('child_process').spawnSync;
|
||||||
|
|
||||||
const args = [`--debug-brk=${common.PORT}`, `-e`, `0`];
|
const args = [`--debug-brk=${common.PORT}`, '-e', '0'];
|
||||||
const proc = spawnSync(process.execPath, args, {encoding: 'utf8'});
|
const proc = spawnSync(process.execPath, args, {encoding: 'utf8'});
|
||||||
assert(/Debugger listening on/.test(proc.stderr));
|
assert(/Debugger listening on/.test(proc.stderr));
|
||||||
|
@ -4,7 +4,7 @@ const common = require('../common');
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
|
|
||||||
const args = [`--debug`, `--debug-port=${common.PORT}`, `--interactive`];
|
const args = ['--debug', `--debug-port=${common.PORT}`, '--interactive'];
|
||||||
const proc = spawn(process.execPath, args, { stdio: 'pipe' });
|
const proc = spawn(process.execPath, args, { stdio: 'pipe' });
|
||||||
proc.stdin.write(`
|
proc.stdin.write(`
|
||||||
util.inspect(Promise.resolve(42));
|
util.inspect(Promise.resolve(42));
|
||||||
|
@ -4,10 +4,10 @@ const assert = require('assert');
|
|||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
const server_port = common.PORT;
|
const server_port = common.PORT;
|
||||||
const message_to_send = 'A message to send';
|
const message_to_send = 'A message to send';
|
||||||
let server, client;
|
let client;
|
||||||
let timer;
|
let timer;
|
||||||
|
|
||||||
server = dgram.createSocket('udp4');
|
const server = dgram.createSocket('udp4');
|
||||||
server.on('message', function(msg, rinfo) {
|
server.on('message', function(msg, rinfo) {
|
||||||
console.log('server got: ' + msg +
|
console.log('server got: ' + msg +
|
||||||
' from ' + rinfo.address + ':' + rinfo.port);
|
' from ' + rinfo.address + ':' + rinfo.port);
|
||||||
|
@ -126,7 +126,6 @@ function run_test_3() {
|
|||||||
var file, options;
|
var file, options;
|
||||||
|
|
||||||
const data = '\u2026\u2026'; // 3 bytes * 2 = 6 bytes in UTF-8
|
const data = '\u2026\u2026'; // 3 bytes * 2 = 6 bytes in UTF-8
|
||||||
let fileData;
|
|
||||||
|
|
||||||
options = { start: 10,
|
options = { start: 10,
|
||||||
flags: 'r+' };
|
flags: 'r+' };
|
||||||
@ -144,7 +143,7 @@ function run_test_3() {
|
|||||||
console.log(' (debug: start ', file.start);
|
console.log(' (debug: start ', file.start);
|
||||||
console.log(' (debug: pos ', file.pos);
|
console.log(' (debug: pos ', file.pos);
|
||||||
assert.strictEqual(file.bytesWritten, data.length * 3);
|
assert.strictEqual(file.bytesWritten, data.length * 3);
|
||||||
fileData = fs.readFileSync(filepath, 'utf8');
|
const fileData = fs.readFileSync(filepath, 'utf8');
|
||||||
console.log(' (debug: file data ', fileData);
|
console.log(' (debug: file data ', fileData);
|
||||||
console.log(' (debug: expected ', fileDataExpected_3);
|
console.log(' (debug: expected ', fileDataExpected_3);
|
||||||
assert.equal(fileData, fileDataExpected_3);
|
assert.equal(fileData, fileDataExpected_3);
|
||||||
|
@ -90,7 +90,7 @@ function test_simple_relative_symlink(callback) {
|
|||||||
[
|
[
|
||||||
[entry, '../' + common.tmpDirName + '/cycles/root.js']
|
[entry, '../' + common.tmpDirName + '/cycles/root.js']
|
||||||
].forEach(function(t) {
|
].forEach(function(t) {
|
||||||
try {fs.unlinkSync(t[0]);}catch (e) {}
|
try {fs.unlinkSync(t[0]);} catch (e) {}
|
||||||
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');
|
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');
|
||||||
fs.symlinkSync(t[1], t[0], 'file');
|
fs.symlinkSync(t[1], t[0], 'file');
|
||||||
unlink.push(t[0]);
|
unlink.push(t[0]);
|
||||||
|
@ -316,12 +316,11 @@ joinTests.forEach(function(test) {
|
|||||||
test[1].forEach(function(test) {
|
test[1].forEach(function(test) {
|
||||||
const actual = join.apply(null, test[0]);
|
const actual = join.apply(null, test[0]);
|
||||||
const expected = test[1];
|
const expected = test[1];
|
||||||
let actualAlt;
|
|
||||||
// For non-Windows specific tests with the Windows join(), we need to try
|
// For non-Windows specific tests with the Windows join(), we need to try
|
||||||
// replacing the slashes since the non-Windows specific tests' `expected`
|
// replacing the slashes since the non-Windows specific tests' `expected`
|
||||||
// use forward slashes
|
// use forward slashes
|
||||||
if (join === path.win32.join)
|
const actualAlt = (join === path.win32.join) ?
|
||||||
actualAlt = actual.replace(/\\/g, '/');
|
actual.replace(/\\/g, '/') : undefined;
|
||||||
const fn = 'path.' +
|
const fn = 'path.' +
|
||||||
(join === path.win32.join ? 'win32' : 'posix') +
|
(join === path.win32.join ? 'win32' : 'posix') +
|
||||||
'.join(';
|
'.join(';
|
||||||
|
@ -5,13 +5,13 @@ const tls = require('tls');
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const ca1 =
|
const ca1 =
|
||||||
fs.readFileSync(`${common.fixturesDir}/keys/ca1-cert.pem`, `utf8`);
|
fs.readFileSync(`${common.fixturesDir}/keys/ca1-cert.pem`, 'utf8');
|
||||||
const ca2 =
|
const ca2 =
|
||||||
fs.readFileSync(`${common.fixturesDir}/keys/ca2-cert.pem`, `utf8`);
|
fs.readFileSync(`${common.fixturesDir}/keys/ca2-cert.pem`, 'utf8');
|
||||||
const cert =
|
const cert =
|
||||||
fs.readFileSync(`${common.fixturesDir}/keys/agent3-cert.pem`, `utf8`);
|
fs.readFileSync(`${common.fixturesDir}/keys/agent3-cert.pem`, 'utf8');
|
||||||
const key =
|
const key =
|
||||||
fs.readFileSync(`${common.fixturesDir}/keys/agent3-key.pem`, `utf8`);
|
fs.readFileSync(`${common.fixturesDir}/keys/agent3-key.pem`, 'utf8');
|
||||||
|
|
||||||
function test(ca, next) {
|
function test(ca, next) {
|
||||||
const server = tls.createServer({ ca, cert, key }, function(conn) {
|
const server = tls.createServer({ ca, cert, key }, function(conn) {
|
||||||
|
@ -259,20 +259,19 @@ var parseTests = {
|
|||||||
path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s='
|
path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s='
|
||||||
},
|
},
|
||||||
|
|
||||||
'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=':
|
'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': {
|
||||||
{
|
href: 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' +
|
||||||
href: 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' +
|
'&hl=en&src=api&x=2&y=2&z=3&s=',
|
||||||
'&hl=en&src=api&x=2&y=2&z=3&s=',
|
protocol: 'http:',
|
||||||
protocol: 'http:',
|
slashes: true,
|
||||||
slashes: true,
|
host: 'mt0.google.com',
|
||||||
host: 'mt0.google.com',
|
auth: 'user:pass',
|
||||||
auth: 'user:pass',
|
hostname: 'mt0.google.com',
|
||||||
hostname: 'mt0.google.com',
|
search: '???&hl=en&src=api&x=2&y=2&z=3&s=',
|
||||||
search: '???&hl=en&src=api&x=2&y=2&z=3&s=',
|
query: '??&hl=en&src=api&x=2&y=2&z=3&s=',
|
||||||
query: '??&hl=en&src=api&x=2&y=2&z=3&s=',
|
pathname: '/vt/lyrs=m@114',
|
||||||
pathname: '/vt/lyrs=m@114',
|
path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s='
|
||||||
path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s='
|
},
|
||||||
},
|
|
||||||
|
|
||||||
'file:///etc/passwd': {
|
'file:///etc/passwd': {
|
||||||
href: 'file:///etc/passwd',
|
href: 'file:///etc/passwd',
|
||||||
|
@ -56,9 +56,9 @@ if (process.argv[2] === 'child') {
|
|||||||
|
|
||||||
let disconnected = 0;
|
let disconnected = 0;
|
||||||
server.on('listening', function() {
|
server.on('listening', function() {
|
||||||
let j = count, client;
|
let j = count;
|
||||||
while (j--) {
|
while (j--) {
|
||||||
client = net.connect(common.PORT, '127.0.0.1');
|
const client = net.connect(common.PORT, '127.0.0.1');
|
||||||
client.on('close', function() {
|
client.on('close', function() {
|
||||||
disconnected += 1;
|
disconnected += 1;
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,6 @@ const contents = fs.readFileSync(doc).toString();
|
|||||||
|
|
||||||
const tokens = marked.lexer(contents, {});
|
const tokens = marked.lexer(contents, {});
|
||||||
let files = null;
|
let files = null;
|
||||||
let blockName;
|
|
||||||
let id = 0;
|
let id = 0;
|
||||||
|
|
||||||
// Just to make sure that all examples will be processed
|
// Just to make sure that all examples will be processed
|
||||||
@ -28,7 +27,7 @@ oldDirs = oldDirs.filter(function(dir) {
|
|||||||
for (var i = 0; i < tokens.length; i++) {
|
for (var i = 0; i < tokens.length; i++) {
|
||||||
var token = tokens[i];
|
var token = tokens[i];
|
||||||
if (token.type === 'heading' && token.text) {
|
if (token.type === 'heading' && token.text) {
|
||||||
blockName = token.text;
|
const blockName = token.text;
|
||||||
if (files && Object.keys(files).length !== 0) {
|
if (files && Object.keys(files).length !== 0) {
|
||||||
verifyFiles(files,
|
verifyFiles(files,
|
||||||
blockName,
|
blockName,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user