@@ -42,7 +42,7 @@ import {
42
42
validateObject ,
43
43
} from 'node-internal:validators' ;
44
44
45
- import * as process from 'node-internal:internal_process ' ;
45
+ import * as process from 'node-internal:process ' ;
46
46
47
47
import { spliceOne } from 'node-internal:internal_utils' ;
48
48
@@ -163,8 +163,6 @@ export function addAbortListener(signal: AbortSignal, listener: any) {
163
163
}
164
164
165
165
export default EventEmitter ;
166
-
167
- // NOTE: all properties of event emitter must also be re-exported by the events.ts wrapper
168
166
EventEmitter . on = on ;
169
167
EventEmitter . once = once ;
170
168
EventEmitter . getEventListeners = getEventListeners ;
@@ -497,34 +495,26 @@ function _addListener(
497
495
`added to an EventEmitter. Use ` +
498
496
'emitter.setMaxListeners() to increase limit'
499
497
) ;
500
- const w : EventEmitterError = Object . assign (
501
- new Error (
502
- 'Possible EventEmitter memory leak detected. ' +
503
- `${ existing . length } ${ String ( type ) } listeners ` +
504
- `added to ${ inspect ( target , { depth : - 1 } ) } . Use ` +
505
- 'emitter.setMaxListeners() to increase limit'
506
- ) ,
507
- {
508
- name : 'MaxListenersExceededWarning' ,
509
- emitter : target ,
510
- type : type ,
511
- count : existing . length ,
512
- }
513
- ) ;
514
- process . emitWarning ( w ) ;
498
+ // TODO(soon): Implement process.emitWarning and inspect
499
+ // // No error code for this since it is a Warning
500
+ // // eslint-disable-next-line no-restricted-syntax
501
+ // const w = new Error(
502
+ // "Possible EventEmitter memory leak detected. " +
503
+ // `${existing.length} ${String(type)} listeners ` +
504
+ // `added to ${inspect(target, { depth: -1 })}. Use ` +
505
+ // "emitter.setMaxListeners() to increase limit",
506
+ // );
507
+ // w.name = "MaxListenersExceededWarning";
508
+ // w.emitter = target;
509
+ // w.type = type;
510
+ // w.count = existing.length;
511
+ // process.emitWarning(w);
515
512
}
516
513
}
517
514
518
515
return target ;
519
516
}
520
517
521
- interface EventEmitterError extends Error {
522
- name : string ;
523
- emitter : unknown ;
524
- type : string | symbol ;
525
- count : number ;
526
- }
527
-
528
518
EventEmitter . prototype . addListener = function addListener (
529
519
type : string | symbol ,
530
520
listener : unknown
@@ -1030,8 +1020,3 @@ export function on(
1030
1020
iterator . return ( ) ;
1031
1021
}
1032
1022
}
1033
-
1034
- // Initialize the process global as an event emitter, if process executed first
1035
- if ( process . _initialized ) process . _initProcess ( ) ;
1036
-
1037
- export var _initialized = true ;
0 commit comments