()
| 5961 | // This variable should be used *only* inside the cacheState function. |
| 5962 | var lastCachedState = null; |
| 5963 | function cacheState() { |
| 5964 | // This should be the only place in $browser where `history.state` is read. |
| 5965 | cachedState = getCurrentState(); |
| 5966 | cachedState = isUndefined(cachedState) ? null : cachedState; |
| 5967 | |
| 5968 | // Prevent callbacks fo fire twice if both hashchange & popstate were fired. |
| 5969 | if (equals(cachedState, lastCachedState)) { |
| 5970 | cachedState = lastCachedState; |
| 5971 | } |
| 5972 | lastCachedState = cachedState; |
| 5973 | } |
| 5974 | |
| 5975 | function fireUrlChange() { |
| 5976 | if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { |
no test coverage detected