Reduce underscore build size.

Former-commit-id: 207d4ab49063483245dc951d4646413d6d4a1903
This commit is contained in:
John-David Dalton
2012-09-29 12:04:40 -07:00
parent f31598f916
commit 82bc52b909
4 changed files with 38 additions and 17 deletions

View File

@@ -667,11 +667,13 @@
function createCallback(func, thisArg) {
if (!func) {
return identity;
} else if (typeof func != 'function') {
}
if (typeof func != 'function') {
return function(object) {
return object[func];
}
} else if (thisArg !== undefined) {
};
}
if (thisArg !== undefined) {
return function(value, index, object) {
return func.call(thisArg, value, index, object);
};
@@ -1693,13 +1695,10 @@
* // => ['one', 'two', 'three'] (order is not guaranteed)
*/
var keys = !nativeKeys ? shimKeys : function(object) {
var type = typeof object;
// avoid iterating over the `prototype` property
if (type == 'function' && propertyIsEnumerable.call(object, 'prototype')) {
return shimKeys(object);
}
return nativeKeys(object);
return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype')
? shimKeys(object)
: nativeKeys(object);
};
/**