()
| 6204 | // This variable should be used *only* inside the cacheState function. |
| 6205 | var lastCachedState = null; |
| 6206 | function cacheState() { |
| 6207 | // This should be the only place in $browser where `history.state` is read. |
| 6208 | cachedState = getCurrentState(); |
| 6209 | cachedState = isUndefined(cachedState) ? null : cachedState; |
| 6210 | |
| 6211 | // Prevent callbacks fo fire twice if both hashchange & popstate were fired. |
| 6212 | if (equals(cachedState, lastCachedState)) { |
| 6213 | cachedState = lastCachedState; |
| 6214 | } |
| 6215 | lastCachedState = cachedState; |
| 6216 | } |
| 6217 | |
| 6218 | function fireUrlChange() { |
| 6219 | if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { |
no test coverage detected