mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 04:37:50 +00:00
Update vendor/underscore and continue to tweak _.throttle unit tests to avoid false fails.
Former-commit-id: b5ba7b53e3bbebb3fa42da7e197f746515c8efb0
This commit is contained in:
16
vendor/underscore/underscore.js
vendored
16
vendor/underscore/underscore.js
vendored
@@ -938,8 +938,8 @@
|
||||
return obj === Object(obj);
|
||||
};
|
||||
|
||||
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
|
||||
each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
|
||||
// Add some isType methods: isArguments, isString, isNumber, isDate, isRegExp.
|
||||
each(['Arguments', 'String', 'Number', 'Date', 'RegExp'], function(name) {
|
||||
_['is' + name] = function(obj) {
|
||||
return toString.call(obj) == '[object ' + name + ']';
|
||||
};
|
||||
@@ -953,10 +953,16 @@
|
||||
};
|
||||
}
|
||||
|
||||
// Optimize `isFunction` if appropriate.
|
||||
if (typeof (/./) !== 'function') {
|
||||
// Is a given variable a function?
|
||||
_.isFunction = function(obj) {
|
||||
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) {
|
||||
return typeof obj === 'function';
|
||||
return toString.call(obj) == '[object Function]';
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user