Skip to content

Commit

Permalink
Fix bug in comparison logic of object property (#22348)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vreality64 authored and kelset committed Dec 12, 2018
1 parent 30c2fb8 commit 692fc2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/vendor/core/mergeInto.js
Expand Up @@ -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];
Expand Down

0 comments on commit 692fc2e

Please sign in to comment.