Skip to content

Commit

Permalink
Update index.js (#2)
Browse files Browse the repository at this point in the history
use hasOwnProperty via call, as some object types don't inherit from Object (node 6+ EventEmitter, for example), so the method may not be there.
  • Loading branch information
tracker1 authored and sdgluck committed Mar 28, 2017
1 parent d50a928 commit 065ce96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function mewt (target) {
},
get: (_, prop) => {
if (api[prop]) return api[prop]
return target[prop] && (target.hasOwnProperty(prop) ? target[prop] : override(prop))
return target[prop] && (Object.prototype.hasOwnProperty.call(target, prop) ? target[prop] : override(prop))
}
})
}

0 comments on commit 065ce96

Please sign in to comment.