File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ Domain.prototype.bind = function(cb) {
446446EventEmitter . usingDomains = true ;
447447
448448const eventInit = EventEmitter . init ;
449- EventEmitter . init = function ( ) {
449+ EventEmitter . init = function ( opts ) {
450450 ObjectDefineProperty ( this , 'domain' , {
451451 configurable : true ,
452452 enumerable : false ,
@@ -457,7 +457,7 @@ EventEmitter.init = function() {
457457 this . domain = exports . active ;
458458 }
459459
460- return FunctionPrototypeCall ( eventInit , this ) ;
460+ return FunctionPrototypeCall ( eventInit , this , opts ) ;
461461} ;
462462
463463const eventEmit = EventEmitter . prototype . emit ;
Original file line number Diff line number Diff line change @@ -321,6 +321,8 @@ EventEmitter.setMaxListeners =
321321 }
322322 } ;
323323
324+ // If you're updating this function definition, please also update any
325+ // re-definitions, such as the one in the Domain module (lib/domain.js).
324326EventEmitter . init = function ( opts ) {
325327
326328 if ( this . _events === undefined ||
Original file line number Diff line number Diff line change @@ -18,3 +18,11 @@ d.on('error', common.mustCall((err) => {
1818
1919d . add ( e ) ;
2020e . emit ( 'error' , new Error ( 'foobar' ) ) ;
21+
22+ {
23+ // Ensure initial params pass to origin `EventEmitter.init` function
24+ const e = new EventEmitter ( { captureRejections : true } ) ;
25+ const kCapture = Object . getOwnPropertySymbols ( e )
26+ . find ( ( it ) => it . description === 'kCapture' ) ;
27+ assert . strictEqual ( e [ kCapture ] , true ) ;
28+ }
You can’t perform that action at this time.
0 commit comments