* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 5390 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 5391 | */ |
| 5392 | function completeOutstandingRequest(fn) { |
| 5393 | try { |
| 5394 | fn.apply(null, sliceArgs(arguments, 1)); |
| 5395 | } finally { |
| 5396 | outstandingRequestCount--; |
| 5397 | if (outstandingRequestCount === 0) { |
| 5398 | while (outstandingRequestCallbacks.length) { |
| 5399 | try { |
| 5400 | outstandingRequestCallbacks.pop()(); |
| 5401 | } catch (e) { |
| 5402 | $log.error(e); |
| 5403 | } |
| 5404 | } |
| 5405 | } |
| 5406 | } |
| 5407 | } |
| 5408 | |
| 5409 | function getHash(url) { |
| 5410 | var index = url.indexOf('#'); |