Update docs and builds.

Former-commit-id: 6bb15d3ad0d4d189ad5e27e1dd79d2a070a568b2
This commit is contained in:
John-David Dalton
2013-04-01 23:54:35 -07:00
parent b0d942d0ec
commit 265ca8ba67
8 changed files with 267 additions and 262 deletions

34
dist/lodash.compat.js vendored
View File

@@ -18,9 +18,9 @@
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) {
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal;
}
@@ -30,6 +30,9 @@
/** Used internally to indicate various things */
var indicatorObject = {};
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
var keyPrefix = +new Date + '';
/** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
@@ -175,7 +178,7 @@
toString = objectRef.toString;
/* Native method shortcuts for methods with the same name as other `lodash` methods */
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = context.isFinite,
nativeIsNaN = context.isNaN,
@@ -579,16 +582,14 @@
index = fromIndex - 1;
while (++index < length) {
// manually coerce `value` to a string because `hasOwnProperty`, in some
// older versions of Firefox, coerces objects incorrectly
var key = String(array[index]);
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
var key = keyPrefix + array[index];
(cache[key] || (cache[key] = [])).push(array[index]);
}
}
return function(value) {
if (isLarge) {
var key = String(value);
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
var key = keyPrefix + value;
return cache[key] && indexOf(cache[key], value) > -1;
}
return indexOf(array, value, fromIndex) > -1;
}
@@ -2030,9 +2031,10 @@
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
var isShallow;
if (callback) {
result = callback(value, source);
if (typeof result != 'undefined') {
if ((isShallow = typeof result != 'undefined')) {
value = result;
}
}
@@ -2041,7 +2043,7 @@
stackB.push(value);
// recursively merge objects and arrays (susceptible to call stack limits)
if (!callback) {
if (!isShallow) {
value = merge(value, source, indicatorObject, callback, stackA, stackB);
}
}
@@ -3613,8 +3615,8 @@
while (++index < length) {
var value = array[index];
if (isLarge) {
var key = String(value);
var inited = hasOwnProperty.call(cache[0], key)
var key = keyPrefix + value;
var inited = cache[0][key]
? !(seen = cache[0][key])
: (seen = cache[0][key] = []);
}
@@ -4021,8 +4023,8 @@
computed = callback ? callback(value, index, array) : value;
if (isLarge) {
var key = String(computed);
var inited = hasOwnProperty.call(cache, key)
var key = keyPrefix + computed;
var inited = cache[key]
? !(seen = cache[key])
: (seen = cache[key] = []);
}
@@ -4507,7 +4509,7 @@
function memoize(func, resolver) {
var cache = {};
return function() {
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]);
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));