// A stream to push an array into a REPL
function ArrayStream() {
this.run = function(data) {
- data.forEach(line => {
+ data.forEach((line) => {
this.emit('data', line + '\n');
});
};
testBlockTypeError(assert.doesNotThrow, undefined);
// https://github.com/nodejs/node/issues/3275
-assert.throws(() => { throw 'error'; }, err => err === 'error');
-assert.throws(() => { throw new Error(); }, err => err instanceof Error);
+assert.throws(() => { throw 'error'; }, (err) => err === 'error');
+assert.throws(() => { throw new Error(); }, (err) => err instanceof Error);
console.log('All OK');
function init(id) {
- keyList = keyList.filter(e => e != pkeys[id]);
+ keyList = keyList.filter((e) => e != pkeys[id]);
}
function noop() { }
// scanner but is ignored by atoi(3). Heinous hack.
cluster.setupMaster({ execArgv: [`--debug=${common.PORT}.`] });
const worker = cluster.fork();
- worker.on('message', common.mustCall(message => {
+ worker.on('message', common.mustCall((message) => {
assert.strictEqual(Array.isArray(message), true);
assert.strictEqual(message[0], 'listening');
let continueRecv = false;
const debugClient = net.connect({ host, port: common.PORT });
const protocol = new Protocol();
debugClient.setEncoding('utf8');
- debugClient.on('data', data => protocol.execute(data));
+ debugClient.on('data', (data) => protocol.execute(data));
debugClient.once('connect', common.mustCall(() => {
- protocol.onResponse = common.mustCall(res => {
+ protocol.onResponse = common.mustCall((res) => {
protocol.onResponse = (res) => {
// It can happen that the first continue was sent before the break
// event was received. If that's the case, send also a continue from
throw ex;
});
} else {
- const server = net.createServer(socket => socket.pipe(socket));
+ const server = net.createServer((socket) => socket.pipe(socket));
const cb = () => {
process.send(['listening', server.address()]);
debugger;
}));
let stdout = '';
proc.stdout.setEncoding('utf8');
-proc.stdout.on('data', data => stdout += data);
+proc.stdout.on('data', (data) => stdout += data);
process.on('exit', () => {
assert(stdout.includes('Promise { 42 }'));
assert(stdout.includes('Promise { 1337 }'));
child.stderr.setEncoding('utf8');
let stderr = '';
-child.stderr.on('data', data => {
+child.stderr.on('data', (data) => {
stderr += data;
if (child.killed !== true && stderr.includes('all workers are running'))
child.kill();
var clientLocalPorts = [];
var serverRemotePorts = [];
const client = new net.Socket();
-const server = net.createServer(socket => {
+const server = net.createServer((socket) => {
serverRemotePorts.push(socket.remotePort);
socket.end();
});
const assert = require('assert');
const sym = Symbol();
-process.on('normal', common.mustCall(data => {
+process.on('normal', common.mustCall((data) => {
assert.strictEqual(data, 'normalData');
}));
-process.on(sym, common.mustCall(data => {
+process.on(sym, common.mustCall((data) => {
assert.strictEqual(data, 'symbolData');
}));
-process.on('SIGPIPE', common.mustCall(data => {
+process.on('SIGPIPE', common.mustCall((data) => {
assert.strictEqual(data, 'signalData');
}));
process.chdir(common.fixturesDir);
const repl = require('repl');
-const server = net.createServer(conn => {
+const server = net.createServer((conn) => {
repl.start('', conn).on('exit', () => {
conn.destroy();
server.close();
server.listen(options, function() {
const conn = net.connect(options);
conn.setEncoding('utf8');
- conn.on('data', data => answer += data);
+ conn.on('data', (data) => answer += data);
conn.write('require("baz")\n.exit\n');
});
client.stdout.pipe(process.stdout);
client.stderr.pipe(process.stderr);
client.stderr.setEncoding('utf8');
- client.stderr.on('data', data => stderr += data);
+ client.stderr.on('data', (data) => stderr += data);
client.once('exit', common.mustCall(function(exitCode) {
assert.equal(exitCode, 1);
}));
});
-server.on('clientError', err => errors.push(err));
+server.on('clientError', (err) => errors.push(err));
process.on('exit', function() {
if (/unknown option -ssl3/.test(stderr)) {