-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Allow getting non-enumerable properties #54
Conversation
Side note: no code changes around enumerability were ever applied to anything but |
I need your opinion; does it really make sense to check enumerability at all? I just read through the original issue about it (#23) and I'm not sure I buy the argument anymore. Also, it's weird that the check is only applied to |
Con: it really does work different from normal object access(obviously ignoring whole exception vs Pro: it actually seems to better match expectations and frequent use-cases. This bug is about inherited properties and it makes sense it should read inherited properties. For the other cases, it silently protects from sometimes hard to trace bugs. All in all, I'd say I'm for doing enumerability checks. Logic should probably be applied to all methods, yeah. (Though logic will always be weirdly different between reading and modifying methods for prototypes.) |
I vote for removing related code of enumerability. |
@sindresorhus So, what are we going for there? Removal of enumerability checks or unifying method behavior? |
@sindresorhus Request to get this merged, though I understand it might qualify as a major release bump. I don't see any reason that a value's enumerable value should matter if someone explicitly tries to access it using .get / .has |
Remove the enumerability checks. |
Side note, I feel like this package could use a bit more tests. Nothing exact of the top of my head, but I can't believe existing ones cover all the tricky stuff. |
@stroncium Comment in #70 if you have any ideas of what the tests might be. |
Changes the way to check property for enumerability, fixes #46