Skip to content

Return null when value not found #9

Merged
merged 1 commit into from Jan 20, 2013

3 participants

@hildjj
hildjj commented Jan 20, 2013

Throwing an exception is for exceptional cases. Not finding the target data doesn't feel like an exceptional case, particularly if I'm going to use the pointer as a filter to select from a set of objects that might match.

@hildjj hildjj Return null instead of throwing an exception when the pointer is vali…
…d, but the doc does not contain the given value.
ea7d1ce
@janl
Owner
janl commented Jan 20, 2013

Agreed.

Note to self. this breaks BC and we must bump to version 2.x.y.

@janl janl merged commit 99a7865 into janl:master Jan 20, 2013
@hildjj
hildjj commented Jan 20, 2013

Agree with BC issue. Wait for compile patch before releasing 2.x though?

@janl
Owner
janl commented Jan 20, 2013

Can do, but no biggie, I am fast and loose with major version numbers, I wouldn’t mind shipping 2.0.0 tonight and 3.0.0 tomorrow ;)

I’ll play it by ear if anyone wants this in a release asap, if not it can wait.

@benatkin

I can use this fix. What's the compile patch?

@janl
Owner
janl commented Jun 14, 2013

hm?

@benatkin

It was @hildjj that said "Wait for compile patch before releasing 2.x though?"

Another note, it ought to return undefined rather than null. That would be a convenient way to differentiate between finding "null" and not finding the key at all.

@hildjj
hildjj commented Jun 15, 2013

I was talking about hildjj@1c373d5

@janl
Owner
janl commented Jun 15, 2013

@benatkin good point, wanna open a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.