Fix bug in comparison logic of object property (#22348)

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: https://github.com/facebook/react-native/pull/22348

Differential Revision: D13334882

Pulled By: cpojer

fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
This commit is contained in:
Ian Park
2018-12-12 16:58:23 +00:00
committed by Lorenzo Sciandra
parent 30c2fb814c
commit 692fc2e4d9
+1 -1
View File
@@ -47,7 +47,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];