Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6c81b75
deps: add example of comparing OpenSSL changes
danbev May 26, 2017
d319015
deps: upgrade openssl sources to 1.0.2l
danbev May 26, 2017
b0b52bc
deps: copy all openssl header files to include dir
danbev May 26, 2017
22d74c4
deps: fix openssl assembly error on ia32 win32
indutny Jan 8, 2014
32bbf7a
deps: fix asm build error of openssl in x86_win32
Feb 13, 2015
b7a80dd
openssl: fix keypress requirement in apps on win32
Feb 17, 2015
f90919f
deps: add -no_rand_screen to openssl s_client
May 27, 2015
02a04cf
deps: update openssl config files
danbev May 26, 2017
99cadcb
deps: update openssl asm and asm_obsolete files
danbev Jun 1, 2017
e510003
doc: add missing make command to UPGRADING.md
danbev May 30, 2017
6602954
doc: consistent case for primitive types
silverwind Feb 4, 2017
40babf1
doc: linkify type[] syntax, support lowercase for primitives
silverwind Feb 14, 2017
e70cb6a
tools: fix lint issue in doctool
silverwind Mar 2, 2017
311ef42
doc/tools: fix more type inconsistencies
silverwind Mar 5, 2017
ae20511
test: enable setuid/setgid test
Trott Apr 13, 2017
4848862
test: introduce `common.crashOnUnhandledRejection`
addaleax Apr 19, 2017
dfcefd6
test,doc: document `crashOnUnhandledRejection()`
addaleax Apr 27, 2017
321c90f
zlib: fix node crashing on invalid options
aqrln May 22, 2017
04fb72f
crypto: clear err stack after ECDH::BufferToPoint
rfk May 29, 2017
11c7e01
v8: fix build errors with g++ 7
Jun 9, 2017
099694f
test: move test-debug-brk to sequential
gibfahn Jun 9, 2017
7a22964
test: move common.PORT debug tests to sequential
gibfahn Jun 10, 2017
7da19db
doc: update output examples in debugger.md
vsemozhetbyt Jun 17, 2017
b2d59b1
benchmark: add final clean-up to module-loader.js
vsemozhetbyt Mar 19, 2017
7af83ff
test: add internal/socket_list tests
davidtaikocha Mar 29, 2017
beb1644
doc: argument types for https methods
ameliavoncat Mar 3, 2017
6f86285
doc: minor improvements in BUILDING.md
thefourtheye Apr 1, 2017
f7abf36
test: add basic cctest for base64.h
aqrln Apr 5, 2017
cde1e9d
tools: replace custom new-with-error rule
Trott Apr 6, 2017
ba51c18
test: remove disabled tls_server.js
Trott Apr 7, 2017
7093711
tools: replace custom assert.fail lint rule
Trott Apr 9, 2017
6d0c4ed
build: clear stalled jobs on POSIX CI hosts
Trott Feb 8, 2017
6d7795f
doc: update os.uptime() and process.uptime() info
vsemozhetbyt Apr 9, 2017
163b3cb
src: remove superfluous env_string string
bnoordhuis Oct 20, 2016
fa9d6ad
src: make cross-context MakeCallback() calls work
bnoordhuis Oct 21, 2016
e3dacbf
test: remove disabled test-dgram-send-error
Trott Apr 11, 2017
01cb518
build: avoid passing kill empty input in Makefile
gibfahn Apr 1, 2017
f359682
test: run the addon tests last
seppevs Mar 27, 2017
ff637f1
build: disable -O3 for C++ coverage
addaleax Apr 13, 2017
ef1afdc
benchmark,windows: TCP.readStart() meaningful only after completion
refack Apr 6, 2017
cff0043
test: replace [].join() with ''.repeat()
JacksonTian Apr 10, 2017
6578884
test: remove common.PORT from multiple tests
tarunbatra Apr 16, 2017
5a86259
test: fix coverity UNINIT_CTOR cctest warning
bnoordhuis Apr 13, 2017
8fdc978
test: dynamic port in cluster worker wait close
Apr 17, 2017
c2afcea
repl: support hidden history file on Windows
bzoz Apr 20, 2017
7714f97
repl: fix /dev/null history file regression
mscdex Apr 30, 2017
03f8ffe
doc: modernize and fix code examples in repl.md
vsemozhetbyt Apr 24, 2017
172cbfc
test: dynamic port in parallel regress tests
Apr 26, 2017
17cb9ca
test: replace indexOf with includes
gwer Apr 22, 2017
cdd5b52
tools: ignore node_trace.*.log
watilde May 2, 2017
2532fb4
stream: remove unnecessary parameter
Aug 17, 2016
f607d85
build: add static option to vcbuild.bat
Apr 30, 2017
c4c7e9b
test,lib,doc: use function declarations
Trott Apr 28, 2017
35cc20b
tools: require function declarations
Trott Apr 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test,lib,doc: use function declarations
Replace function expressions with function declarations in preparation
for a lint rule requiring function declarations.

PR-URL: #12711
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information
Trott committed Jun 19, 2017
commit c4c7e9b8583b3bb8705b0083e4cd28db30090bb0
2 changes: 1 addition & 1 deletion doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ Returns `true` if the given `object` is a `Function`. Otherwise, returns
const util = require('util');

function Foo() {}
const Bar = function() {};
const Bar = () => {};

util.isFunction({});
// Returns: false
Expand Down
2 changes: 1 addition & 1 deletion lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
cb();
}

var onSocket = function() {
var onSocket = () => {
if (self.socket.writable) {
callSocketMethod();
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/_tls_legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ CryptoStream.prototype.destroySoon = function(err) {
// was written on this side was read from the other side.
var self = this;
var waiting = 1;
var finish = function() {
function finish() {
if (--waiting === 0) self.destroy();
};
}
this._opposite.once('end', finish);
if (!this._finished) {
this.once('finish', finish);
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,11 @@ function pbkdf2(password, salt, iterations, keylen, digest, callback) {
// at this point, we need to handle encodings.
var encoding = exports.DEFAULT_ENCODING;
if (callback) {
var next = function(er, ret) {
function next(er, ret) {
if (ret)
ret = ret.toString(encoding);
callback(er, ret);
};
}
binding.PBKDF2(password, salt, iterations, keylen, digest, next);
} else {
var ret = binding.PBKDF2(password, salt, iterations, keylen, digest);
Expand Down
4 changes: 2 additions & 2 deletions test/addons/make-callback/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ const forward = vm.runInNewContext(`
})
`);
// Runs in outer context.
const endpoint = function($Object) {
function endpoint($Object) {
if (Object === $Object)
throw new Error('bad');
return Object;
};
}
assert.strictEqual(Object, makeCallback(process, forward, endpoint));
8 changes: 4 additions & 4 deletions test/inspector/inspector-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function timeout(message, multiplicator) {
TIMEOUT * (multiplicator || 1));
}

const TestSession = function(socket, harness) {
function TestSession(socket, harness) {
this.mainScriptPath = harness.mainScriptPath;
this.mainScriptId = null;

Expand All @@ -145,7 +145,7 @@ const TestSession = function(socket, harness) {
buffer = buffer.slice(consumed);
} while (consumed);
}).on('close', () => assert(this.expectClose_, 'Socket closed prematurely'));
};
}

TestSession.prototype.scriptUrlForId = function(id) {
return this.scripts_[id];
Expand Down Expand Up @@ -302,7 +302,7 @@ TestSession.prototype.testHttpResponse = function(path, check) {
};


const Harness = function(port, childProcess) {
function Harness(port, childProcess) {
this.port = port;
this.mainScriptPath = mainScript;
this.stderrFilters_ = [];
Expand All @@ -327,7 +327,7 @@ const Harness = function(port, childProcess) {
this.returnCode_ = code;
this.running_ = false;
});
};
}

Harness.prototype.addStderrFilter = function(regexp, callback) {
this.stderrFilters_.push((message) => {
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ try {

AnotherErrorType = class extends Error {};

const functionThatThrows = function() {
const functionThatThrows = () => {
throw new AnotherErrorType('foo');
};

Expand Down Expand Up @@ -466,6 +466,7 @@ a.throws(makeBlock(a.deepEqual, args, []));

// more checking that arguments objects are handled correctly
{
// eslint-disable-next-line func-style
const returnArguments = function() { return arguments; };

const someArgs = returnArguments('a');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-child-process-fork-dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (process.argv[2] === 'child') {
});
});

const sendMessages = function() {
function sendMessages() {
const serverPort = parentServer.address().port;

const timer = setInterval(function() {
Expand All @@ -81,7 +81,7 @@ if (process.argv[2] === 'child') {
);
}
}, 1);
};
}

parentServer.bind(0, '127.0.0.1');

Expand Down
12 changes: 6 additions & 6 deletions test/parallel/test-child-process-fork-net.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (process.argv[2] === 'child') {
}));

// send net.Server to child and test by connecting
const testServer = function(callback) {
function testServer(callback) {

// destroy server execute callback when done
const progress = new ProgressTracker(2, function() {
Expand Down Expand Up @@ -95,7 +95,7 @@ if (process.argv[2] === 'child') {
server.listen(0);

// handle client messages
const messageHandlers = function(msg) {
function messageHandlers(msg) {

if (msg.what === 'listening') {
// make connections
Expand All @@ -117,13 +117,13 @@ if (process.argv[2] === 'child') {
child.removeListener('message', messageHandlers);
callback();
}
};
}

child.on('message', messageHandlers);
};
}

// send net.Socket to child
const testSocket = function(callback) {
function testSocket(callback) {

// create a new server and connect to it,
// but the socket will be handled by the child
Expand Down Expand Up @@ -158,7 +158,7 @@ if (process.argv[2] === 'child') {
server.close();
});
});
};
}

// create server and send it to child
let serverSuccess = false;
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-child-process-fork-net2.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if (process.argv[2] === 'child') {

server.listen(0, '127.0.0.1');

let closeServer = function() {
function closeServer() {
server.close();

setTimeout(function() {
Expand All @@ -132,7 +132,7 @@ if (process.argv[2] === 'child') {
child2.send('close');
child3.disconnect();
}, 200);
};
}

process.on('exit', function() {
assert.strictEqual(disconnected, count);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-spawn-typeerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ assert.throws(function() {
// Argument types for combinatorics
const a = [];
const o = {};
const c = function c() {};
function c() {}
const s = 'string';
const u = undefined;
const n = null;
Expand Down
8 changes: 4 additions & 4 deletions test/parallel/test-cluster-disconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (cluster.isWorker) {
const servers = 2;

// test a single TCP server
const testConnection = function(port, cb) {
const testConnection = (port, cb) => {
const socket = net.connect(port, '127.0.0.1', () => {
// buffer result
let result = '';
Expand All @@ -31,7 +31,7 @@ if (cluster.isWorker) {
};

// test both servers created in the cluster
const testCluster = function(cb) {
const testCluster = (cb) => {
let done = 0;

for (let i = 0; i < servers; i++) {
Expand All @@ -46,7 +46,7 @@ if (cluster.isWorker) {
};

// start two workers and execute callback when both is listening
const startCluster = function(cb) {
const startCluster = (cb) => {
const workers = 8;
let online = 0;

Expand All @@ -60,7 +60,7 @@ if (cluster.isWorker) {
}
};

const test = function(again) {
const test = (again) => {
//1. start cluster
startCluster(common.mustCall(() => {
//2. test cluster
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-master-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if (cluster.isWorker) {
// Check that the cluster died accidentally (non-zero exit code)
masterExited = !!code;

const pollWorkers = function() {
const pollWorkers = () => {
// When master is dead all workers should be dead too
let alive = false;
workers.forEach((pid) => alive = common.isAlive(pid));
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-master-kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (cluster.isWorker) {
assert.strictEqual(code, 0);

// check worker process status
const pollWorker = function() {
const pollWorker = () => {
alive = common.isAlive(pid);
if (alive) {
setTimeout(pollWorker, 50);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (cluster.isWorker) {


let client;
const check = function(type, result) {
const check = (type, result) => {
checks[type].receive = true;
checks[type].correct = result;
console.error('check', checks);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-worker-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if (cluster.isWorker) {
}
}));

const finish_test = function() {
const finish_test = () => {
try {
checkResults(expected_results, results);
} catch (exc) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-console-not-call-toString.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require('../common');
const assert = require('assert');

const func = function() {};
function func() {}
let toStringCalled = false;
func.toString = function() {
toStringCalled = true;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-pid.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const interfacer = spawn(process.execPath, ['debug', '-p', '655555']);
console.error(process.execPath, 'debug', '-p', '655555');
interfacer.stdout.setEncoding('utf-8');
interfacer.stderr.setEncoding('utf-8');
const onData = function(data) {
const onData = (data) => {
data = (buffer + data).split('\n');
buffer = data.pop();
data.forEach(function(line) {
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-event-emitter-add-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const EventEmitter = require('events');
}

{
const listen1 = function listen1() {};
const listen2 = function listen2() {};
const listen1 = () => {};
const listen2 = () => {};
const ee = new EventEmitter();

ee.once('newListener', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-event-emitter-once.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ e.emit('hello', 'a', 'b');
e.emit('hello', 'a', 'b');
e.emit('hello', 'a', 'b');

const remove = function() {
function remove() {
common.fail('once->foo should not be emitted');
};
}

e.once('foo', remove);
e.removeListener('foo', remove);
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-fs-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ const doesNotExist = path.join(common.tmpDir, '__this_should_not_exist');
const readOnlyFile = path.join(common.tmpDir, 'read_only_file');
const readWriteFile = path.join(common.tmpDir, 'read_write_file');

const removeFile = function(file) {
const removeFile = (file) => {
try {
fs.unlinkSync(file);
} catch (err) {
// Ignore error
}
};

const createFileWithPerms = function(file, mode) {
function createFileWithPerms(file, mode) {
removeFile(file);
fs.writeFileSync(file, '');
fs.chmodSync(file, mode);
};
}

common.refreshTmpDir();
createFileWithPerms(readOnlyFile, 0o444);
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-fs-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const srcPath = path.join(common.tmpDir, 'hardlink-target.txt');
const dstPath = path.join(common.tmpDir, 'link1.js');
fs.writeFileSync(srcPath, 'hello world');

const callback = function(err) {
if (err) throw err;
function callback(err) {
assert.ifError(err);
const dstContent = fs.readFileSync(dstPath, 'utf8');
assert.strictEqual('hello world', dstContent);
};
}

fs.link(srcPath, dstPath, common.mustCall(callback));

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-fs-read-stream-fd-leak.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function testLeak(endFn, callback) {
let i = 0;
let check = 0;

const checkFunction = function() {
function checkFunction() {
if (openCount !== 0 && check < totalCheck) {
check++;
setTimeout(checkFunction, 100);
Expand All @@ -44,7 +44,7 @@ function testLeak(endFn, callback) {

openCount = 0;
callback && setTimeout(callback, 100);
};
}

setInterval(function() {
const s = fs.createReadStream(emptyTxt);
Expand Down
Loading