-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
prop.get(user, 'name.first') will throw if name is null #11
Comments
Maybe we should check the accessibility of the property? |
Yeah, that's a bug. It should never throw no matter what you feed it. That's the whole point of this module. |
@sindresorhus do you want to support situation that a getter might throw? the only way is to |
Yes |
I think I know what you are going to say @sindresorhus , you probably just don't want to 'throw' from this module (and don't care too much about the performance) but the reason I try to avoid 'try...catch' and this module to 'throw' was to avoid regression. Sent from my iPhone
|
try/catch doesn't have to mean worse performance. try/catch only deoptimizes the current function. If you put it in a helper function you're good. |
Ok, I'll get my Mac next Monday so seven more days if you guys don't mind waiting :) |
I can wait. I don't have time to look into this right now anyways. |
@matthewmueller @sindresorhus please review #12 :) |
Seems weird to me that this library throws on things like:
null
,false
,3
,"hi"
.I feel like the
obj === undefined
check should beisObj(obj)
or something.The text was updated successfully, but these errors were encountered: