Skip to content

Commit c3b3eb7

Browse files
vreality64facebook-github-bot
authored andcommitted
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: #22348 Differential Revision: D13334882 Pulled By: cpojer fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
1 parent 198eb02 commit c3b3eb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/vendor/core/mergeInto.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function mergeInto(one, two) {
2323
if (two != null) {
2424
checkMergeObjectArg(two);
2525
for (var key in two) {
26-
if (!two.hasOwnProperty(key)) {
26+
if (!Object.prototype.hasOwnProperty.call(two, key)) {
2727
continue;
2828
}
2929
one[key] = two[key];

0 commit comments

Comments
 (0)