Continue dependency map tweaking, and simplify how _.isArguments is handled in the underscore build.

Former-commit-id: 568887e067d6463f102b3b866195f3a173fc6d4f
This commit is contained in:
John-David Dalton
2013-01-27 11:23:02 -08:00
parent 1c63e2d295
commit 4815600e85
3 changed files with 62 additions and 63 deletions

View File

@@ -453,13 +453,13 @@
// create the function factory
var factory = Function(
'createCallback, hasOwnProperty, isArray, isString, ' +
'createCallback, hasOwnProperty, isArguments, isArray, isString, ' +
'objectTypes, nativeKeys, propertyIsEnumerable',
'return function(' + args + ') {\n' + (data) + '\n}'
);
// return the compiled function
return factory(
createCallback, hasOwnProperty, isArray, isString,
createCallback, hasOwnProperty, isArguments, isArray, isString,
objectTypes, nativeKeys, propertyIsEnumerable
);
}
@@ -581,6 +581,7 @@
}
/*--------------------------------------------------------------------------*/
/**
* Checks if `value` is an `arguments` object.
*
@@ -597,13 +598,12 @@
* _.isArguments([1, 2, 3]);
* // => false
*/
lodash.isArguments = function(value) {
function isArguments(value) {
return toString.call(value) == argsClass;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!lodash.isArguments(arguments)) {
lodash.isArguments = function(value) {
if (!isArguments(arguments)) {
isArguments = function(value) {
return value ? hasOwnProperty.call(value, 'callee') : false;
};
}
@@ -852,7 +852,7 @@
* // => false
*/
function clone(value) {
return value && objectTypes[typeof value]
return isObject(value)
? (isArray(value) ? slice(value) : assign({}, value))
: value
}
@@ -3873,6 +3873,7 @@
lodash.has = has;
lodash.identity = identity;
lodash.indexOf = indexOf;
lodash.isArguments = isArguments;
lodash.isArray = isArray;
lodash.isBoolean = isBoolean;
lodash.isDate = isDate;