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

Closed
wants to merge 1 commit into from

Conversation

@ExE-Boss
Copy link
Contributor

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
Collaborator

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
Projects
None yet
2 participants
You can’t perform that action at this time.