Skip to content

Commit 18c4dd5

Browse files
vreality64grabbou
authored andcommitted
Fix bug in comparison logic of object property (facebook#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 facebook#22308 issue. (Fixes facebook#22308) Pull Request resolved: facebook#22348 Differential Revision: D13334882 Pulled By: cpojer fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
1 parent a7d0e48 commit 18c4dd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/vendor/core/mergeInto.js

Lines changed: 1 addition & 1 deletion
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)