(key, args)
| 2511 | } |
| 2512 | |
| 2513 | function runLoggingCallbacks(key, args) { |
| 2514 | var callbacks = config.callbacks[key]; |
| 2515 | |
| 2516 | // Handling 'log' callbacks separately. Unlike the other callbacks, |
| 2517 | // the log callback is not controlled by the processing queue, |
| 2518 | // but rather used by asserts. Hence to promisfy the 'log' callback |
| 2519 | // would mean promisfying each step of a test |
| 2520 | if (key === "log") { |
| 2521 | callbacks.map(function (callback) { |
| 2522 | return callback(args); |
| 2523 | }); |
| 2524 | return; |
| 2525 | } |
| 2526 | |
| 2527 | // ensure that each callback is executed serially |
| 2528 | return callbacks.reduce(function (promiseChain, callback) { |
| 2529 | return promiseChain.then(function () { |
| 2530 | return Promise$1.resolve(callback(args)); |
| 2531 | }); |
| 2532 | }, Promise$1.resolve([])); |
| 2533 | } |
| 2534 | |
| 2535 | // Doesn't support IE9, it will return undefined on these browsers |
| 2536 | // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack |
no outgoing calls
no test coverage detected