nl_tokens: Get the property descriptor for the event attribute of a given event .
pl_tokens: function defineEventAttributeDescriptor ( eventName ) { return { get ( ) { const listeners = getListeners ( this ) ; let node = listeners . get ( eventName ) ; while ( node != null ) { if ( node . listenerType === ATTRIBUTE ) { return node . listener } node = node . next ; } return null } , set ( listener ) { if ( typeof listener !== "function" && ! isObject ( listener ) ) { listener = null ; // eslint-disable-line no-param-reassign } const listeners = getListeners ( this ) ; // Traverse to the tail while removing old value. let prev = null ; let node = listeners . get ( eventName ) ; while ( node != null ) { if ( node . listenerType === ATTRIBUTE ) { // Remove old value. if ( prev !== null ) { prev . next = node . next ; } else if ( node . next !== null ) { listeners . <mask> ( eventName , node . next ) ; } else { listeners . delete ( eventName ) ; } } else { prev = node ; } node = node . next ; } // Add new value. if ( listener !== null ) { const newNode = { listener , listenerType : ATTRIBUTE , passive : false , once : false , next : null , } ; if ( prev === null ) { listeners . set ( eventName , newNode ) ; } else { prev . next = newNode ; } } } , configurable : true , enumerable : true , } }