Skip to content

Commit

Permalink
Fix bug in comparison logic of object property (#22348)
Browse files Browse the repository at this point in the history
Summary:
`instance.hasOwnProperty` has potential danger because of some object could be eliminate own prototype chain. Update code be more reliable.

This PR is solution of #22308 issue. (Fixes #22308)
Pull Request resolved: #22348

Differential Revision: D13334882

Pulled By: cpojer

fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
  • Loading branch information
vreality64 authored and facebook-github-bot committed Dec 5, 2018
1 parent 198eb02 commit c3b3eb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/vendor/core/mergeInto.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function mergeInto(one, two) {
if (two != null) {
checkMergeObjectArg(two);
for (var key in two) {
if (!two.hasOwnProperty(key)) {
if (!Object.prototype.hasOwnProperty.call(two, key)) {
continue;
}
one[key] = two[key];
Expand Down

0 comments on commit c3b3eb7

Please sign in to comment.