@@ -2,6 +2,8 @@ import * as p from "node:process";
22import { finalization } from "node:process" ;
33import assert = require( "node:assert" ) ;
44import EventEmitter = require( "node:events" ) ;
5+ import * as dgram from "node:dgram" ;
6+ import * as net from "node:net" ;
57import { constants } from "node:os" ;
68import { dlopen } from "node:process" ;
79import { fileURLToPath } from "node:url" ;
@@ -17,7 +19,7 @@ import { fileURLToPath } from "node:url";
1719 assert . ok ( process . argv [ 0 ] === process . argv0 ) ;
1820}
1921{
20- process . on ( "message" , ( req : any ) => { } ) ;
22+ process . on ( "message" , ( message : unknown , sendHandle : net . Server | net . Socket | dgram . Socket | undefined ) => { } ) ;
2123 process . addListener ( "beforeExit" , ( code : number ) => { } ) ;
2224 process . once ( "disconnect" , ( ) => { } ) ;
2325 process . prependListener ( "exit" , ( code : number ) => { } ) ;
@@ -26,7 +28,10 @@ import { fileURLToPath } from "node:url";
2628 process . once ( "uncaughtExceptionMonitor" , ( error : Error ) => { } ) ;
2729 process . addListener ( "unhandledRejection" , ( reason : unknown , promise : Promise < unknown > ) => { } ) ;
2830 process . once ( "warning" , ( warning : Error ) => { } ) ;
29- process . prependListener ( "message" , ( message : any , sendHandle : any ) => { } ) ;
31+ process . prependListener (
32+ "message" ,
33+ ( message : any , sendHandle : net . Server | net . Socket | dgram . Socket | undefined ) => { } ,
34+ ) ;
3035 process . prependOnceListener ( "SIGBREAK" , ( ) => { } ) ;
3136 process . emit ( "SIGINT" ) ;
3237 process . on ( "newListener" , ( event : string | symbol , listener : Function ) => { } ) ;
@@ -74,9 +79,15 @@ import { fileURLToPath } from "node:url";
7479 }
7580 if ( process . send ) {
7681 let r : boolean = process . send ( "aMessage" ) ;
77- r = process . send ( { msg : "foo" } , { } ) ;
78- r = process . send ( { msg : "foo" } , { } , { keepOpen : true } ) ;
79- r = process . send ( { msg : "foo" } , { } , { keepOpen : true } , ( err : Error | null ) => { } ) ;
82+ r = process . send ( { msg : "foo" } , new net . Server ( ) ) ;
83+ r = process . send ( { msg : "foo" } , new net . Socket ( ) ) ;
84+ r = process . send ( { msg : "foo" } , new dgram . Socket ( ) ) ;
85+ r = process . send ( { msg : "foo" } , new net . Server ( ) , { keepOpen : true } ) ;
86+ r = process . send ( { msg : "foo" } , new net . Socket ( ) , { keepOpen : true } ) ;
87+ r = process . send ( { msg : "foo" } , new dgram . Socket ( ) , { keepOpen : true } ) ;
88+ r = process . send ( { msg : "foo" } , new net . Server ( ) , { keepOpen : true } , ( err : Error | null ) => { } ) ;
89+ r = process . send ( { msg : "foo" } , new net . Socket ( ) , { keepOpen : true } , ( err : Error | null ) => { } ) ;
90+ r = process . send ( { msg : "foo" } , new dgram . Socket ( ) , { keepOpen : true } , ( err : Error | null ) => { } ) ;
8091 }
8192}
8293
0 commit comments