()
| 5546 | // This variable should be used *only* inside the cacheState function. |
| 5547 | var lastCachedState = null; |
| 5548 | function cacheState() { |
| 5549 | // This should be the only place in $browser where `history.state` is read. |
| 5550 | cachedState = getCurrentState(); |
| 5551 | cachedState = isUndefined(cachedState) ? null : cachedState; |
| 5552 | |
| 5553 | // Prevent callbacks fo fire twice if both hashchange & popstate were fired. |
| 5554 | if (equals(cachedState, lastCachedState)) { |
| 5555 | cachedState = lastCachedState; |
| 5556 | } |
| 5557 | lastCachedState = cachedState; |
| 5558 | } |
| 5559 | |
| 5560 | function fireUrlChange() { |
| 5561 | if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { |
no test coverage detected