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 <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 1818d9c commit 3e58871

26 files changed

Lines changed: 42 additions & 0 deletions

‎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
functioncb2(arg1,arg2){
1718
j++;
1819
if(j===n)
1920
bench.end(n);
2021
}
22+
2123
functioncb3(arg1,arg2,arg3){
2224
j++;
2325
if(j===n)
2426
bench.end(n);
2527
}
28+
2629
functioncb4(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
functioncb3(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
functioncb2(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
functioncb1(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
functioncb1(arg1){}
15+
1516
functioncb2(arg1,arg2){}
17+
1618
functioncb3(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
functioncb2(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
functioncb1(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
functioncb2(arg1,arg2){
1617
j++;
1718
if(j===n)
1819
bench.end(n);
1920
}
21+
2022
functioncb3(arg1,arg2,arg3){
2123
j++;
2224
if(j===n)
2325
bench.end(n);
2426
}
27+
2528
functioncb4(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
functioncb(){
2020
process.nextTick(counter);
2121
}
22+
2223
functioncb2(){
2324
process.nextTick(counter);
2425
}
26+
2527
functioncounter(){
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
functioncb2(){
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
functioncb2(){
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
functionthrowingFirst() {
12571257
thrownewError('First');
12581258
}
1259+
12591260
functionthrowingSecond() {
12601261
thrownewError('Second');
12611262
}
1263+
12621264
functionnotThrowing() {}
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
functioncallFinal(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
functionprefinish(stream,state){
638640
if(!state.prefinished&&!state.finalCalled){
639641
if(typeofstream._final==='function'&&!state.destroyed){

0 commit comments

Comments
 (0)