()
| 5135 | // This variable should be used *only* inside the cacheState function. |
| 5136 | var lastCachedState = null; |
| 5137 | function cacheState() { |
| 5138 | // This should be the only place in $browser where `history.state` is read. |
| 5139 | cachedState = getCurrentState(); |
| 5140 | cachedState = isUndefined(cachedState) ? null : cachedState; |
| 5141 | |
| 5142 | // Prevent callbacks fo fire twice if both hashchange & popstate were fired. |
| 5143 | if (equals(cachedState, lastCachedState)) { |
| 5144 | cachedState = lastCachedState; |
| 5145 | } |
| 5146 | lastCachedState = cachedState; |
| 5147 | } |
| 5148 | |
| 5149 | function fireUrlChange() { |
| 5150 | if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { |
no test coverage detected