Update docs and builds.

Former-commit-id: 21791e052114af5907d76251c58c3ba2ca138873
This commit is contained in:
John-David Dalton
2013-03-25 08:35:20 -07:00
parent 14343b5410
commit 87f1d55bc2
7 changed files with 240 additions and 261 deletions

83
dist/lodash.compat.js vendored
View File

@@ -365,7 +365,7 @@
* @type Boolean
*/
try {
support.nodeClass = !(toString.call(document) == objectClass && !String({ 'toString': 0 }));
support.nodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch(e) {
support.nodeClass = true;
}
@@ -500,11 +500,9 @@
if (support.enumPrototypes || obj.useHas) {
__p += '\n }';
}
__p += '\n } ';
}
__p += '\n } ';
if (support.nonEnumShadows) {
__p += '\n\n var ctor = iterable.constructor;\n ';
__p += '\n\n var ctor = iterable.constructor;\n ';
for (var k = 0; k < 7; k++) {
__p += '\n index = \'' +
(obj.shadowedProps[k]) +
@@ -514,7 +512,9 @@
}
__p += 'hasOwnProperty.call(iterable, index)) {\n ' +
(obj.loop) +
'\n } ';
'\n } ';
}
}
}
@@ -744,22 +744,6 @@
);
}
/**
* A function compiled to iterate `arguments` objects, arrays, objects, and
* strings consistenly across environments, executing the `callback` for each
* element in the `collection`. The `callback` is bound to `thisArg` and invoked
* with three arguments; (value, index|key, collection). Callbacks may exit
* iteration early by explicitly returning `false`.
*
* @private
* @type Function
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array|Object|String} Returns `collection`.
*/
var each = createIterator(eachIteratorOptions);
/**
* Used by `template` to escape characters for inclusion in compiled
* string literals.
@@ -793,7 +777,7 @@
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof String(value) == 'string';
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
/**
@@ -836,7 +820,8 @@
}
// check that the constructor is `Object` (i.e. `Object instanceof Object`)
var ctor = value.constructor;
if ((!isFunction(ctor) && (support.nodeClass || !isNode(value))) || ctor instanceof ctor) {
if (isFunction(ctor) ? ctor instanceof ctor : (support.nodeClass || !isNode(value))) {
// IE < 9 iterates inherited properties before own properties. If the first
// iterated property is an object's own property then there are no inherited
// enumerable properties.
@@ -858,23 +843,6 @@
return result;
}
/**
* A fallback implementation of `Object.keys` that produces an array of the
* given object's own enumerable property names.
*
* @private
* @type Function
* @param {Object} object The object to inspect.
* @returns {Array} Returns a new array of property names.
*/
var shimKeys = createIterator({
'args': 'object',
'init': '[]',
'top': 'if (!(objectTypes[typeof object])) return result',
'loop': 'result.push(index)',
'arrays': false
});
/**
* Slices the `collection` from the `start` index up to, but not including,
* the `end` index.
@@ -964,6 +932,23 @@
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
};
/**
* A fallback implementation of `Object.keys` that produces an array of the
* given object's own enumerable property names.
*
* @private
* @type Function
* @param {Object} object The object to inspect.
* @returns {Array} Returns a new array of property names.
*/
var shimKeys = createIterator({
'args': 'object',
'init': '[]',
'top': 'if (!(objectTypes[typeof object])) return result',
'loop': 'result.push(index)',
'arrays': false
});
/**
* Creates an array composed of the own enumerable property names of `object`.
*
@@ -988,6 +973,22 @@
return nativeKeys(object);
};
/**
* A function compiled to iterate `arguments` objects, arrays, objects, and
* strings consistenly across environments, executing the `callback` for each
* element in the `collection`. The `callback` is bound to `thisArg` and invoked
* with three arguments; (value, index|key, collection). Callbacks may exit
* iteration early by explicitly returning `false`.
*
* @private
* @type Function
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array|Object|String} Returns `collection`.
*/
var each = createIterator(eachIteratorOptions);
/**
* Used to convert characters to HTML entities:
*