@@ -203,7 +203,7 @@ EventEmitter.init = function(opts) {
203203 this . _maxListeners = this . _maxListeners || undefined ;
204204
205205
206- if ( opts && opts . captureRejections ) {
206+ if ( opts ? .captureRejections ) {
207207 if ( typeof opts . captureRejections !== 'boolean' ) {
208208 throw new ERR_INVALID_ARG_TYPE ( 'options.captureRejections' ,
209209 'boolean' , opts . captureRejections ) ;
@@ -709,9 +709,9 @@ function getEventListeners(emitterOrTarget, type) {
709709}
710710
711711async function once ( emitter , name , options = { } ) {
712- const signal = options ? options . signal : undefined ;
712+ const signal = options ? .signal ;
713713 validateAbortSignal ( signal , 'options.signal' ) ;
714- if ( signal && signal . aborted )
714+ if ( signal ? .aborted )
715715 throw lazyDOMException ( 'The operation was aborted' , 'AbortError' ) ;
716716 return new Promise ( ( resolve , reject ) => {
717717 const errorListener = ( err ) => {
@@ -791,7 +791,7 @@ function eventTargetAgnosticRemoveListener(emitter, name, listener, flags) {
791791
792792function eventTargetAgnosticAddListener ( emitter , name , listener , flags ) {
793793 if ( typeof emitter . on === 'function' ) {
794- if ( flags && flags . once ) {
794+ if ( flags ? .once ) {
795795 emitter . once ( name , listener ) ;
796796 } else {
797797 emitter . on ( name , listener ) ;
@@ -806,9 +806,9 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
806806}
807807
808808function on ( emitter , event , options ) {
809- const { signal } = { ... options } ;
809+ const signal = options ?. signal ;
810810 validateAbortSignal ( signal , 'options.signal' ) ;
811- if ( signal && signal . aborted ) {
811+ if ( signal ? .aborted ) {
812812 throw lazyDOMException ( 'The operation was aborted' , 'AbortError' ) ;
813813 }
814814
0 commit comments