No longer compile _.assign, _.defaults, or _.forOwn.

This commit is contained in:
John-David Dalton
2013-12-13 09:11:58 -08:00
parent 7fcbc3c003
commit 60a1374fb4
7 changed files with 321 additions and 264 deletions

View File

@@ -1195,17 +1195,19 @@
* });
* // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
*/
var forOwn = function(collection, callback) {
var index, iterable = collection, result = iterable;
if (!iterable) return result;
if (!objectTypes[typeof iterable]) return result;
for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) {
if (callback(iterable[index], index, collection) === indicatorObject) return result;
}
function forOwn(object, callback) {
var index = -1,
props = keys(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === indicatorObject) {
break;
}
return result
};
}
return object;
}
/**
* Creates a sorted array of property names of all enumerable properties,