Skip to content

Commit 3e58871

Browse files
Trotttargos
authored andcommitted
benchmark,doc,lib,test: prepare for padding lint rule
Upcoming lint rule will require a blank line between consecutive functions. Add it in the places where we don't have it already. PR-URL: #30696 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 1818d9c commit 3e58871

26 files changed

+42
-0
lines changed

benchmark/process/next-tick-breadth-args.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@ function main({ n }) {
1313
if (j === n)
1414
bench.end(n);
1515
}
16+
1617
function cb2(arg1, arg2) {
1718
j++;
1819
if (j === n)
1920
bench.end(n);
2021
}
22+
2123
function cb3(arg1, arg2, arg3) {
2224
j++;
2325
if (j === n)
2426
bench.end(n);
2527
}
28+
2629
function cb4(arg1, arg2, arg3, arg4) {
2730
j++;
2831
if (j === n)

benchmark/process/next-tick-depth-args.js

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function main({ n }) {
2020
} else
2121
bench.end(n);
2222
}
23+
2324
function cb3(arg1, arg2, arg3) {
2425
if (--counter) {
2526
if (counter % 4 === 0)
@@ -33,6 +34,7 @@ function main({ n }) {
3334
} else
3435
bench.end(n);
3536
}
37+
3638
function cb2(arg1, arg2) {
3739
if (--counter) {
3840
if (counter % 4 === 0)
@@ -46,6 +48,7 @@ function main({ n }) {
4648
} else
4749
bench.end(n);
4850
}
51+
4952
function cb1(arg1) {
5053
if (--counter) {
5154
if (counter % 4 === 0)

benchmark/timers/set-immediate-breadth-args.js

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ function main({ n }) {
1212
});
1313

1414
function cb1(arg1) {}
15+
1516
function cb2(arg1, arg2) {}
17+
1618
function cb3(arg1, arg2, arg3) {}
1719

1820
bench.start();

benchmark/timers/set-immediate-depth-args.js

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function main({ n }) {
2121
setImmediate(cb1, n);
2222
}
2323
}
24+
2425
function cb2(n, arg2) {
2526
if (--n) {
2627
if (n % 3 === 0)
@@ -31,6 +32,7 @@ function main({ n }) {
3132
setImmediate(cb1, n);
3233
}
3334
}
35+
3436
function cb1(n) {
3537
if (--n) {
3638
if (n % 3 === 0)

benchmark/timers/timers-breadth-args.js

+3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ function main({ n }) {
1212
if (j === n)
1313
bench.end(n);
1414
}
15+
1516
function cb2(arg1, arg2) {
1617
j++;
1718
if (j === n)
1819
bench.end(n);
1920
}
21+
2022
function cb3(arg1, arg2, arg3) {
2123
j++;
2224
if (j === n)
2325
bench.end(n);
2426
}
27+
2528
function cb4(arg1, arg2, arg3, arg4) {
2629
j++;
2730
if (j === n)

benchmark/timers/timers-timeout-nexttick.js

+2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ function main({ n }) {
1919
function cb() {
2020
process.nextTick(counter);
2121
}
22+
2223
function cb2() {
2324
process.nextTick(counter);
2425
}
26+
2527
function counter() {
2628
count++;
2729
if (count === n)

benchmark/timers/timers-timeout-pooled.js

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function main({ n }) {
2020
if (count === n)
2121
bench.end(n);
2222
}
23+
2324
function cb2() {
2425
count++;
2526
if (count === n)

benchmark/timers/timers-timeout-unpooled.js

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function main({ n }) {
2020
if (count === n)
2121
bench.end(n);
2222
}
23+
2324
function cb2() {
2425
count++;
2526
if (count === n)

doc/api/assert.md

+2
Original file line numberDiff line numberDiff line change
@@ -1256,9 +1256,11 @@ a string as the second argument gets considered:
12561256
function throwingFirst() {
12571257
throw new Error('First');
12581258
}
1259+
12591260
function throwingSecond() {
12601261
throw new Error('Second');
12611262
}
1263+
12621264
function notThrowing() {}
12631265

12641266
// The second argument is a string and the input function threw an Error.

lib/_stream_writable.js

+2
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ function needFinish(state) {
623623
!state.finished &&
624624
!state.writing);
625625
}
626+
626627
function callFinal(stream, state) {
627628
stream._final((err) => {
628629
state.pendingcb--;
@@ -634,6 +635,7 @@ function callFinal(stream, state) {
634635
finishMaybe(stream, state);
635636
});
636637
}
638+
637639
function prefinish(stream, state) {
638640
if (!state.prefinished && !state.finalCalled) {
639641
if (typeof stream._final === 'function' && !state.destroyed) {

lib/internal/assert.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function lazyError() {
77
}
88
return error;
99
}
10+
1011
function assert(value, message) {
1112
if (!value) {
1213
const ERR_INTERNAL_ASSERTION = lazyError();

lib/internal/js_stream_socket.js

+4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ const kCurrentShutdownRequest = Symbol('kCurrentShutdownRequest');
1414
const kPendingShutdownRequest = Symbol('kPendingShutdownRequest');
1515

1616
function isClosing() { return this[owner_symbol].isClosing(); }
17+
1718
function onreadstart() { return this[owner_symbol].readStart(); }
19+
1820
function onreadstop() { return this[owner_symbol].readStop(); }
21+
1922
function onshutdown(req) { return this[owner_symbol].doShutdown(req); }
23+
2024
function onwrite(req, bufs) { return this[owner_symbol].doWrite(req, bufs); }
2125

2226
/* This class serves as a wrapper for when the C++ side of Node wants access

lib/internal/process/task_queues.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const kHasTickScheduled = 0;
4646
function hasTickScheduled() {
4747
return tickInfo[kHasTickScheduled] === 1;
4848
}
49+
4950
function setHasTickScheduled(value) {
5051
tickInfo[kHasTickScheduled] = value ? 1 : 0;
5152
}

lib/internal/process/worker_thread_only.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function lazyWorkerStdio() {
1616
if (!workerStdio) workerStdio = createWorkerStdio();
1717
return workerStdio;
1818
}
19+
1920
function createStdioGetters() {
2021
return {
2122
getStdout() { return lazyWorkerStdio().stdout; },

lib/repl.js

+1
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ function REPLServer(prompt,
259259
function pause() {
260260
paused = true;
261261
}
262+
262263
function unpause() {
263264
if (!paused) return;
264265
paused = false;

test/es-module/test-esm-data-urls.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const assert = require('assert');
55
function createURL(mime, body) {
66
return `data:${mime},${body}`;
77
}
8+
89
function createBase64URL(mime, body) {
910
return `data:${mime};base64,${Buffer.from(body).toString('base64')}`;
1011
}

test/parallel/test-event-emitter-listeners.js

+3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ const assert = require('assert');
2626
const events = require('events');
2727

2828
function listener() {}
29+
2930
function listener2() {}
31+
3032
function listener3() {
3133
return 0;
3234
}
35+
3336
function listener4() {
3437
return 1;
3538
}

test/parallel/test-event-emitter-remove-listeners.js

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const assert = require('assert');
2525
const EventEmitter = require('events');
2626

2727
function listener1() {}
28+
2829
function listener2() {}
2930

3031
{

test/parallel/test-fs-realpath.js

+1
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ function test_abs_with_kids(realpath, realpathSync, cb) {
490490
try { fs.rmdirSync(root + folder); } catch {}
491491
});
492492
}
493+
493494
function setup() {
494495
cleanup();
495496
['',

test/parallel/test-http-unix-socket-keep-alive.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function asyncLoop(fn, times, cb) {
2727
}
2828
});
2929
}
30+
3031
function makeKeepAliveRequest(cb) {
3132
http.get({
3233
socketPath: common.PIPE,

test/parallel/test-repl-options.js

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ assert.strictEqual(r1.useColors, r1.rli.terminal);
6262

6363
// 2
6464
function writer() {}
65+
6566
function evaler() {}
6667
const r2 = repl.start({
6768
input: stream,

test/parallel/test-stream-transform-flush-data.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const expected = 'asdf';
1212
function _transform(d, e, n) {
1313
n();
1414
}
15+
1516
function _flush(n) {
1617
n(null, expected);
1718
}

test/parallel/test-tls-fast-writing.js

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ server.listen(0, function() {
6868
process.exit(0);
6969
write();
7070
}
71+
7172
function write() {
7273
// This needs to return false eventually
7374
while (false !== conn.write(chunk));

test/parallel/test-util-promisify.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const stat = promisify(fs.stat);
2626

2727
{
2828
function fn() {}
29+
2930
function promisifedFn() {}
3031
fn[promisify.custom] = promisifedFn;
3132
assert.strictEqual(promisify(fn), promisifedFn);

test/pummel/test-fs-watch-file.js

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ assert.throws(
8989
fs.unwatchFile(filepathTwo, a);
9090
++watchSeenTwo;
9191
}
92+
9293
function b() {
9394
fs.unwatchFile(filepathTwo, b);
9495
++watchSeenTwo;

test/sequential/test-inspector-port-cluster.js

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ function testRunnerMain() {
205205
});
206206
});
207207
}
208+
208209
function masterProcessMain() {
209210
const workers = JSON.parse(process.env.workers);
210211
const clusterSettings = JSON.parse(process.env.clusterSettings) || {};

0 commit comments

Comments
 (0)