From 692fc2e4d903740a187a7d22e68ff3a385c6da5d Mon Sep 17 00:00:00 2001 From: Ian Park Date: Tue, 4 Dec 2018 19:21:57 -0800 Subject: [PATCH] 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 --- Libraries/vendor/core/mergeInto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/vendor/core/mergeInto.js b/Libraries/vendor/core/mergeInto.js index d42b3dcf36ed3f..7ea0d50c7da6b1 100644 --- a/Libraries/vendor/core/mergeInto.js +++ b/Libraries/vendor/core/mergeInto.js @@ -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];