Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PageView cache re-insertions. #4936

Merged
merged 1 commit into from Jun 13, 2014

Conversation

@nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Jun 13, 2014

If a PageView is re-inserted into the cache, there's a splice() call done which I'm pretty sure is supposed to just remove the existing copy. But in Firefox a.splice(n) has a special behaviour -- it causes every element after the nth to be removed. (See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice for details. I don't know what it does in other browsers.) This causes pages to be removed from the cache without having destroy() called on them.

This patch changes it to a.splice(n, 1), which always removes just the single element.

(BTW, there are two splice(i) calls in src/shared/util.js that may also be buggy.)

@yurydelendik
Copy link
Contributor

@yurydelendik yurydelendik commented Jun 13, 2014

Trivial. Thanks

yurydelendik added a commit that referenced this pull request Jun 13, 2014
Fix PageView cache re-insertions.
@yurydelendik yurydelendik merged commit 69d7227 into mozilla:master Jun 13, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@nnethercote nnethercote deleted the nnethercote:fix-cache-splice branch Jun 13, 2014
@nnethercote
Copy link
Contributor Author

@nnethercote nnethercote commented Jun 13, 2014

Yury, do you think the splice(i) calls in src/shared/util.js are buggy?

@yurydelendik
Copy link
Contributor

@yurydelendik yurydelendik commented Jun 13, 2014

do you think the splice(i) calls in src/shared/util.js are buggy?

Maybe, but there are not that important -- there are related to the unhandled rejections in the Promise polyfill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.