Skip to content

Commit

Permalink
Ensure only own keys are returned.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkatic authored and domenic committed Feb 4, 2013
1 parent 78c65c9 commit e6bc235
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion q.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,14 @@ var object_create = Object.create || function (prototype) {
return new Type();
};

var object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);

var object_keys = Object.keys || function (object) {
var keys = [];
for (var key in object) {
keys.push(key);
if (object_hasOwnProperty(object, key)) {
keys.push(key);
}
}
return keys;
};
Expand Down

0 comments on commit e6bc235

Please sign in to comment.