nl_tokens: the synchronous part of emitting
pl_tokens: function recordAndTriggerHandlers ( type , eventData ) { this . history . push ( { type : type , data : eventData } ) this . handlers [ <mask> ] . forEach ( function ( handlerInfo ) { try { handlerInfo . handler . call ( undefined , eventData ) } catch ( e ) { // throw error asynchronously because these error should be separate from the test exceptions var throwErrorFn = options . throwAsyncException if ( handlerInfo . domain ) { throwErrorFn = handlerInfo . domain . bind ( throwErrorFn ) // this domain bind is needed because emit is done inside deadunit's test domain, which isn't where we want to put errors caused by the event handlers } throwErrorFn ( e ) } } ) }