(cherry-pick) fix($browser): prevent infinite digests when clearing the hash of a url#10490
Conversation
|
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
|
Just making sure Travis is happy... |
By using `location.hash` to update the current browser location when only the hash has changed, we prevent the browser from attempting to reload. Closes angular#9629 Closes angular#9635 Closes angular#10228 Closes angular#10308
957ec1f to
ce48f4d
Compare
The original fix for which this mock location logic was written fixes a bug in master which also exists in 1.2.x. Cherry-picking the fix to the 1.2.x branch was difficult because the mock location object used ES5 get/set syntax, which is not supported in IE8. This fix changes the implementation to work with IE8 and modern browsers. IE8's defineProperty only works on certain types of objects, such as DOM elements. So the mock location is a div element in this implementation.
ce48f4d to
97a9119
Compare
|
@petebacondarwin mind taking a look? Also, would you accept this commit into master? 97a9119 The implementation is a little silly, but it'd be nice to keep master and v1.2.x in sync where possible. |
|
I opened a PR with the cherry-pick to master: #10497 |
|
Travis is green, so I'm going to go ahead and merge this into stable since it's causing some internal issues, and since the only new code is a unit test change. |
By using
location.hashto update the current browser location when onlythe hash has changed, we prevent the browser from attempting to reload.
Closes #9629
Closes #9635
Closes #10228
Closes #10308