nl_tokens: Returns the promise callback by type
pl_tokens: function getPromiseCallbacks ( oContext , sType ) { return function ( ) { var aCompleted , nLenPromises , oDeferred , aPromises , nPromise , oPromise , aResults = [ ] ; oContext . bCompleted = true ; oContext . sType = sType ; oContext . oResult = arguments ; while ( oContext . aPending [ 0 ] ) { oContext . aPending . shift ( ) [ sType ] . <mask> ( oContext , arguments ) ; } oDeferred = oContext . oDeferred ; if ( oDeferred ) { aCompleted = [ ] ; aPromises = oDeferred . aPromises ; nLenPromises = aPromises . length ; aResults = [ ] ; for ( nPromise = 0 ; nPromise < nLenPromises ; nPromise ++ ) { oPromise = aPromises [ nPromise ] ; aCompleted . push ( Number ( oPromise . bCompleted ) ) ; aResults . push ( oPromise . oResult ) ; } if ( aCompleted . join ( '' ) . indexOf ( '0' ) === - 1 ) { oDeferred [ sType ] . apply ( oDeferred , aResults ) ; } } } ; }