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

Add support for objects created with a null prototype in objectOf #112

Merged
merged 4 commits into from Jun 19, 2018
Merged

Add support for objects created with a null prototype in objectOf #112

merged 4 commits into from Jun 19, 2018

Conversation

getkey
Copy link
Contributor

@getkey getkey commented Sep 20, 2017

It's all in the title. :-)

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great change. Even better would be to use the has module to be robust against delete Object.prototype.hasOwnProperty :-)

@getkey
Copy link
Contributor Author

getkey commented Sep 21, 2017

I would be happy to add it but isn't it a bit overkill?

@ljharb
Copy link
Collaborator

ljharb commented Sep 22, 2017

The maintainers may think so; but being robust is rarely overkill, especially when it's so easy.

@@ -10,6 +10,7 @@
var emptyFunction = require('fbjs/lib/emptyFunction');
var invariant = require('fbjs/lib/invariant');
var warning = require('fbjs/lib/warning');
var has = require('has');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid taking on more npm deps please? Just inline it. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, Function.call.bind(Object.prototype.hasOwnProperty)

Copy link
Contributor

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's inline it

@gaearon
Copy link
Contributor

gaearon commented Jun 19, 2018

(Sorry for contradictory advice. Since this package is very commonly used we're trying to trim the tree a little bit.)

@getkey
Copy link
Contributor Author

getkey commented Jun 19, 2018

No worries. 🙂

@gaearon gaearon merged commit cfc7f43 into facebook:master Jun 19, 2018
@gaearon
Copy link
Contributor

gaearon commented Jun 19, 2018

Thanks

@getkey getkey deleted the objectof-null-prototype branch June 19, 2018 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants