-
Notifications
You must be signed in to change notification settings - Fork 31
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
For .. in loops not protected from iterating prototype properties #209
Comments
Is it on all Would replacing |
Yes it seems to be all replacing |
We've noticed something similar and have a pull request on our BBC fork at bbc#9 to address this issue, which may help. It's also worth noting that replacing the |
I was thinking the very same thing about potentially improving performance by avoiding any hasOwnProperty checks which I believe slow things down, although I don't have any data to prove that either, just a hunch :-) Anyway, thanks for your comment. Good to know it's not just me that has this problem. Maybe it would make sense to fix this upstream and then rebase the changes into your fork @nigelmegitt |
@xoundboy yes, for sure where we have improvements it's our intention to push them upstream (or fetch them from upstream if others have already done the same) to minimise the deltas between our fork and the main repo. We have some divergence that's required for us to deal with specifics of our environment. |
Just for clarity, the performance improvements don't come from this, but from changing to indexed based array iterator for loops rather than I don't know a way to avoid using |
Great. Looking forward to it. |
@palemieux I verified that |
That would be great! |
OK, I've got a branch ready called |
Even better, any chance you might be able to create the branch on a fork of the repo in your github account? This is the intended Github workflow AFAIK. |
@palemieux This is the first time I'm making a PR in Github using this workflow. Thanks for the guidance. Here's the PR: #210 - it includes some whitespace changes which I didn't notice until too late. Let me know if you need me to revert those. |
Super! Thanks.
Not fatal... just distracting. How difficult is it to revert them? |
It's a real pain to revert them. I'd really prefer not to if possible :) |
Co-authored-by: Ben Roberts <ben.roberts.extern@joyn.de>
I've been testing the library on Samsung and WebOS tvs and discovered that on one 2020 Samsung device execution breaks inside several of the for.. in loops conained in this library due to native prototype properties being iterated as regular array members. I don't know yet exactly why the problem only appears on this TV, however I was easily able to fix it using the hasOwnProperty check. I'm wondering whether I can submit a PR for this change to be merged to master? I have it ready to push. There are quite a few places the check is needed.
The text was updated successfully, but these errors were encountered: