Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
feat(core): Added validation for object own properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ecancino committed Sep 26, 2015
1 parent 0c11713 commit 68d735c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ function protract() {

objects.forEach(function(object) {
for (var property in object) {
var descriptor = Object.getOwnPropertyDescriptor(object, property) || { value: object[property] };
Object.defineProperty(final, property, descriptor);
if (object.hasOwnProperty(property)) {
var descriptor = Object.getOwnPropertyDescriptor(object, property) || { value: object[property] };
Object.defineProperty(final, property, descriptor);
}
}
});

Expand Down

0 comments on commit 68d735c

Please sign in to comment.