function loop(index) {
                    if ( index >= length || !events[ index ] ) {
                        resolve(bindTarget);
                        return null;
                    }
                    args.eventSource = source;
                    args.userData = events[ index ].userData;
                    let result = events[ index ].handler( args );
                    result = (!result || $.type(result) !== "promise") ? $.Promise.resolve() : result;
                    return result.then(() => loop(index + 1));
                }
Get a function which iterates the list of all handlers registered for a given event,
calling the handler for each and awaiting async ones.
@function
@param {String} eventName - Name of event to get handlers for.
@param {any} bindTarget - Bound target to return with the promise on finish