nl_tokens: Add a listener to an event ( or events ) on this object or another evented object .
pl_tokens: function on$$1 ( ) { var _this = this ; for ( var _len = arguments . length , args = Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) { args [ _key ] = arguments [ _key ] ; } var _normalizeListenArgs = normalizeListenArgs ( this , args ) , isTargetingSelf = _normalizeListenArgs . isTargetingSelf , target = _normalizeListenArgs . target , type = _normalizeListenArgs . type , listener = _normalizeListenArgs . listener ; listen ( target , 'on' , type , listener ) ; // If this object is listening to another evented object. if ( ! isTargetingSelf ) { // If this object is disposed, remove the listener. var removeListenerOnDispose = function removeListenerOnDispose ( ) { return _this . off ( target , type , listener ) ; } ; // Use the same function ID as the listener so we can remove it later it // using the ID of the original listener. removeListenerOnDispose . guid = listener . guid ; // Add a listener to the target's dispose event as well. This ensures // that if the target is disposed BEFORE this object, we remove the // removal listener that was just added. Otherwise, we create a memory leak. var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose ( ) { return _this . off ( 'dispose' , removeListenerOnDispose ) ; } ; // Use the same function ID as the listener so we can remove it later // it using the ID of the original listener. removeRemoverOnTargetDispose . guid = listener . guid ; listen ( this , 'on' , 'dispose' , removeListenerOnDispose ) ; listen ( <mask> , 'on' , 'dispose' , removeRemoverOnTargetDispose ) ; } }