mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Lorenzo Sciandra
parent
30c2fb814c
commit
692fc2e4d9
Vendored
+1
-1
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user