src/hooks/HooksRunner.js
function executeEventHandlersSerially (hook, opts) {
    var handlers = events.listeners(hook);
    if (handlers.length) {
        // Chain the handlers in series.
        return handlers.reduce(function (soFar, f) {
            return soFar.then(function () { return f(opts); });
        }, Promise.resolve());
    } else {
        return Promise.resolve(); // Nothing to do.
    }
}
function executeEventHandlersSerially (hook, opts) {
    var handlers = events.listeners(hook);
    if (handlers.length) {
        // Chain the handlers in series.
        return handlers.reduce(function (soFar, f) {
            return soFar.then(function () { return f(opts); });
        }, Promise.resolve());
    } else {
        return Promise.resolve(); // Nothing to do.
    }
}
Returns a promise.