()
| 5921 | // This variable should be used *only* inside the cacheState function. |
| 5922 | var lastCachedState = null; |
| 5923 | function cacheState() { |
| 5924 | // This should be the only place in $browser where `history.state` is read. |
| 5925 | cachedState = getCurrentState(); |
| 5926 | cachedState = isUndefined(cachedState) ? null : cachedState; |
| 5927 | |
| 5928 | // Prevent callbacks fo fire twice if both hashchange & popstate were fired. |
| 5929 | if (equals(cachedState, lastCachedState)) { |
| 5930 | cachedState = lastCachedState; |
| 5931 | } |
| 5932 | lastCachedState = cachedState; |
| 5933 | } |
| 5934 | |
| 5935 | function fireUrlChange() { |
| 5936 | if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { |
no test coverage detected