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

Avoid triggering getters #5

Closed
jonathantneal opened this issue Oct 25, 2016 · 2 comments
Closed

Avoid triggering getters #5

jonathantneal opened this issue Oct 25, 2016 · 2 comments
Assignees

Comments

@jonathantneal
Copy link
Owner

@WebReflection may have mentioned in #4 that I should avoid checking !document.loaded, as it may trigger getters. I’m wondering if I should instead use !('loaded' in document), or what best practice I should follow.

@WebReflection
Copy link

considering one of your solutions there is to lazily assign on get, I think you answered your own question already ;-)

It's a trap either ways, but using in does not involve extra, most likely unnecessary, logic.

@jonathantneal
Copy link
Owner Author

Since feature detection is not part of a ponyfill, I’ll close this. Thanks for your assistance.

@jonathantneal jonathantneal self-assigned this Oct 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants