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
Conversation
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! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
There was a problem hiding this 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
:-)
I would be happy to add it but isn't it a bit overkill? |
The maintainers may think so; but being robust is rarely overkill, especially when it's so easy. |
factoryWithTypeCheckers.js
Outdated
@@ -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'); |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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)
There was a problem hiding this 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
(Sorry for contradictory advice. Since this package is very commonly used we're trying to trim the tree a little bit.) |
No worries. 🙂 |
Thanks |
It's all in the title. :-)