(emitter, type /*, values...*/)
| 8221 | // them to be executed when the last operation ends, or, if no |
| 8222 | // operation is active, when a timeout fires. |
| 8223 | function signalLater(emitter, type /*, values...*/) { |
| 8224 | var arr = getHandlers(emitter, type, false) |
| 8225 | if (!arr.length) return; |
| 8226 | var args = Array.prototype.slice.call(arguments, 2), list; |
| 8227 | if (operationGroup) { |
| 8228 | list = operationGroup.delayedCallbacks; |
| 8229 | } else if (orphanDelayedCallbacks) { |
| 8230 | list = orphanDelayedCallbacks; |
| 8231 | } else { |
| 8232 | list = orphanDelayedCallbacks = []; |
| 8233 | setTimeout(fireOrphanDelayed, 0); |
| 8234 | } |
| 8235 | function bnd(f) {return function(){f.apply(null, args);};}; |
| 8236 | for (var i = 0; i < arr.length; ++i) |
| 8237 | list.push(bnd(arr[i])); |
| 8238 | } |
| 8239 | |
| 8240 | function fireOrphanDelayed() { |
| 8241 | var delayed = orphanDelayedCallbacks; |
no test coverage detected