aboutsummaryrefslogtreecommitdiffstats
path: root/lib/underscore/underscore.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/underscore/underscore.js')
-rw-r--r--lib/underscore/underscore.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/underscore/underscore.js b/lib/underscore/underscore.js
index 7006910e..faadaeb8 100644
--- a/lib/underscore/underscore.js
+++ b/lib/underscore/underscore.js
@@ -38,7 +38,7 @@
propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
// Current version.
- _.VERSION = '0.5.7';
+ _.VERSION = '0.5.8';
// ------------------------ Collection Functions: ---------------------------
@@ -49,7 +49,7 @@
try {
if (obj.forEach) {
obj.forEach(iterator, context);
- } else if (_.isArray(obj) || _.isArguments(obj)) {
+ } else if (_.isNumber(obj.length)) {
for (var i=0, l=obj.length; i<l; i++) iterator.call(context, obj[i], i, obj);
} else {
var keys = _.keys(obj), l = keys.length;
@@ -152,7 +152,7 @@
// Determine if a given value is included in the array or object,
// based on '==='.
_.include = function(obj, target) {
- if (_.isArray(obj)) return _.indexOf(obj, target) != -1;
+ if (obj && _.isFunction(obj.indexOf)) return _.indexOf(obj, target) != -1;
var found = false;
_.each(obj, function(value) {
if (found = value === target) _.breakLoop();
@@ -400,7 +400,7 @@
// Retrieve the names of an object's properties.
_.keys = function(obj) {
- if(_.isArray(obj)) return _.range(0, obj.length);
+ if (_.isArray(obj)) return _.range(0, obj.length);
var keys = [];
for (var key in obj) if (hasOwnProperty.call(obj, key)) keys.push(key);
return keys;