facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 356 forks source link

Support validation when hasOwnProperty is not in prototype #187

Closed dferber90 closed 5 years ago

dferber90 commented 6 years ago

Avoids the Warning: Failed prop type: propValue.hasOwnProperty is not a function warning when hasOwnProperty is not defined in the prototype chain.

See #183 for details.


dferber90 commented 6 years ago

I moved the declaration to module scope now (amended the commit) and added a test for objects with a hasOwnProperty property.

mhuggins commented 5 years ago

Thanks for this fix! Running into this as well. Is there a reason it sits open?

dferber90 commented 5 years ago

@mhuggins It is ready to be merged from my side (aside from the merge conflicts now).

ljharb commented 5 years ago

Rebased this; it's partially addressed by #112 but still includes tests and a fix.

mhuggins commented 5 years ago

Thanks, guys! ❤️