Update vendor/underscore.

Former-commit-id: 9a00fa6c531e8cf0990526b7034cbde67ef335b3
This commit is contained in:
John-David Dalton
2012-12-27 00:08:19 -06:00
parent f4120a9c8c
commit cc1e0daaa4
2 changed files with 6 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@@ -938,8 +938,8 @@
return obj === Object(obj); return obj === Object(obj);
}; };
// Add some isType methods: isArguments, isString, isNumber, isDate, isRegExp. // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
each(['Arguments', 'String', 'Number', 'Date', 'RegExp'], function(name) { each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
_['is' + name] = function(obj) { _['is' + name] = function(obj) {
return toString.call(obj) == '[object ' + name + ']'; return toString.call(obj) == '[object ' + name + ']';
}; };
@@ -953,16 +953,10 @@
}; };
} }
// Is a given variable a function? // Optimize `isFunction` if appropriate.
_.isFunction = function(obj) { if (typeof (/./) !== 'function') {
return typeof obj === 'function';
};
// Define a fallback for older versions of Chrome, Firefox, and Safari, where
// a regexp is `typeof` "function".
if (_.isFunction(/./)) {
_.isFunction = function(obj) { _.isFunction = function(obj) {
return toString.call(obj) == '[object Function]'; return typeof obj === 'function';
}; };
} }