MCPcopy Create free account
hub / github.com/caike/jQuery-Simple-Timer / runLoggingCallbacks

Function runLoggingCallbacks

tests/qunit-2.9.2.js:2513–2533  ·  view source on GitHub ↗
(key, args)

Source from the content-addressed store, hash-verified

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

Callers 4

doneFunction · 0.85
qunit-2.9.2.jsFile · 0.85
logSuiteEndFunction · 0.85
beginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected