Skip to content

Commit da0c673

Browse files
TrottMylesBorins
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 <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 5334f59 commit da0c673

26 files changed

+42
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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) {

0 commit comments

Comments
 (0)