Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

(cherry-pick) fix($browser): prevent infinite digests when clearing the hash of a url #10490

Merged
merged 2 commits into from
Dec 17, 2014

Conversation

jeffbcross
Copy link
Contributor

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 #9629
Closes #9635
Closes #10228
Closes #10308

@googlebot
Copy link

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.

@jeffbcross
Copy link
Contributor Author

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
@jeffbcross jeffbcross force-pushed the pantheon-fix branch 2 times, most recently from 957ec1f to ce48f4d Compare December 17, 2014 09:52
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.
@jeffbcross
Copy link
Contributor Author

@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.

@jeffbcross jeffbcross added this to the 1.3.8 milestone Dec 17, 2014
@jeffbcross
Copy link
Contributor Author

I opened a PR with the cherry-pick to master: #10497

@jeffbcross
Copy link
Contributor Author

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.

@jeffbcross jeffbcross merged commit 97a9119 into angular:v1.2.x Dec 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants