mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
execution time optimisations for _.isArguments, stricter es3 fallback
This commit is contained in:
@@ -739,9 +739,16 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Is a given variable an arguments object?
|
// Is a given variable an arguments object?
|
||||||
_.isArguments = function(obj) {
|
_.isArguments = toString.call(arguments) == '[object Arguments]'
|
||||||
return toString.call(obj) == '[object Arguments]' || !!(obj && hasOwnProperty.call(obj, 'callee'));
|
? function(obj) {
|
||||||
};
|
return toString.call(obj) == '[object Arguments]';
|
||||||
|
}
|
||||||
|
: function(obj) {
|
||||||
|
return obj
|
||||||
|
? hasOwnProperty.call(obj, 'callee')
|
||||||
|
&& hasOwnProperty.call(obj, 'length')
|
||||||
|
: false;
|
||||||
|
};
|
||||||
|
|
||||||
// Is a given value a function?
|
// Is a given value a function?
|
||||||
_.isFunction = function(obj) {
|
_.isFunction = function(obj) {
|
||||||
|
|||||||
Reference in New Issue
Block a user