Skip to content

Commit

Permalink
using a cached reference to hasOwnProperty (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jan 23, 2012
1 parent f1ecedf commit 5ed8b6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
// Create quick reference variables for speed access to core prototypes.
var slice = ArrayProto.slice,
unshift = ArrayProto.unshift,
toString = ObjProto.toString;
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;

// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
Expand Down Expand Up @@ -839,7 +840,7 @@

// Has own property?
_.has = function(obj, key) {
return ObjProto.hasOwnProperty.call(obj, key);
return hasOwnProperty.call(obj, key);
};

// Utility Functions
Expand Down

0 comments on commit 5ed8b6e

Please sign in to comment.