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

fix: `has(…)` returns `false` on `null` or `undefined` #13

wants to merge 1 commit into from


Copy link

commented Oct 7, 2019

Currently, calling has(null, "foo") or has(undefined, "foo") throws a TypeError:

TypeError: Cannot convert undefined or null to object
    at hasOwnProperty (<anonymous>)

This makes it so that calling has(null, "foo") or has(undefined, "foo") returns false instead.

closes #12

Copy link

left a comment

This is already correct, since it’s how hasOwnProperty works.

@ljharb ljharb closed this Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.