Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update lodash

  • Loading branch information...
commit 0e63b6d57baa6f8de87c8f25a5e8926bdd1a2a63 1 parent a9aec0c
Elving Rodriguez authored

Showing 2 changed files with 62 additions and 59 deletions. Show diff stats Hide diff stats

  1. +2 2 README.md
  2. +60 57 vendor/scripts/lodash.js
4 README.md
Source Rendered
@@ -16,8 +16,8 @@ Brunch with Hipsters is a rad [Brunch](http://brunch.io/) app skeleton that come
16 16 - [Font Awesome v3.0.2](https://github.com/FortAwesome/Font-Awesome)
17 17 - [Typeplate v1.0.1](https://github.com/typeplate/typeplate.github.com)
18 18 - [Modernizr v2.6.2](https://github.com/Modernizr/Modernizr)
19   -- [Brunch Auto-Reload v1.3.2](https://github.com/brunch/auto-reload-brunch)
20   -- [Lodash v1.0.1](https://github.com/bestiejs/lodash)
  19 +- [Brunch Auto-Reload v1.5.2](https://github.com/brunch/auto-reload-brunch)
  20 +- [Lodash v1.1.1](https://github.com/bestiejs/lodash)
21 21 - [HTML5 Boilerplate v4.1.0](https://github.com/h5bp/html5-boilerplate)
22 22 - [Coffeelint 1.4.4](https://github.com/ilkosta/coffeelint-brunch)
23 23
117 vendor/scripts/lodash.js
... ... @@ -1,6 +1,6 @@
1 1 /**
2 2 * @license
3   - * Lo-Dash 1.0.1 <http://lodash.com/>
  3 + * Lo-Dash 1.1.1 <http://lodash.com/>
4 4 * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
5 5 * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
6 6 * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
@@ -17,9 +17,9 @@
17 17 /** Detect free variable `module` */
18 18 var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
19 19
20   - /** Detect free variable `global` and use it as `window` */
  20 + /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
21 21 var freeGlobal = typeof global == 'object' && global;
22   - if (freeGlobal.global === freeGlobal) {
  22 + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
23 23 window = freeGlobal;
24 24 }
25 25
@@ -29,6 +29,9 @@
29 29 /** Used internally to indicate various things */
30 30 var indicatorObject = {};
31 31
  32 + /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
  33 + var keyPrefix = +new Date + '';
  34 +
32 35 /** Used to match empty string literals in compiled template source */
33 36 var reEmptyStringLeading = /\b__p \+= '';/g,
34 37 reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
@@ -174,7 +177,7 @@
174 177 toString = objectRef.toString;
175 178
176 179 /* Native method shortcuts for methods with the same name as other `lodash` methods */
177   - var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
  180 + var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
178 181 nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
179 182 nativeIsFinite = context.isFinite,
180 183 nativeIsNaN = context.isNaN,
@@ -364,7 +367,7 @@
364 367 * @type Boolean
365 368 */
366 369 try {
367   - support.nodeClass = !(toString.call(document) == objectClass && !String({ 'toString': 0 }));
  370 + support.nodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
368 371 } catch(e) {
369 372 support.nodeClass = true;
370 373 }
@@ -510,15 +513,14 @@
510 513 ' <%= loop %>;' +
511 514 ' <% if (support.enumPrototypes || useHas) { %>\n }<% } %>\n' +
512 515 ' }' +
513   - ' <% } %>' +
514 516
515 517 // Because IE < 9 can't set the `[[Enumerable]]` attribute of an
516 518 // existing property and the `constructor` property of a prototype
517 519 // defaults to non-enumerable, Lo-Dash skips the `constructor`
518 520 // property when it infers it's iterating over a `prototype` object.
519   - ' <% if (support.nonEnumShadows) { %>\n\n' +
  521 + ' <% if (support.nonEnumShadows) { %>\n\n' +
520 522 ' var ctor = iterable.constructor;\n' +
521   - ' <% for (var k = 0; k < 7; k++) { %>\n' +
  523 + ' <% for (var k = 0; k < 7; k++) { %>\n' +
522 524 " index = '<%= shadowedProps[k] %>';\n" +
523 525 ' if (<%' +
524 526 " if (shadowedProps[k] == 'constructor') {" +
@@ -526,6 +528,7 @@
526 528 ' } %>hasOwnProperty.call(iterable, index)) {\n' +
527 529 ' <%= loop %>\n' +
528 530 ' }' +
  531 + ' <% } %>' +
529 532 ' <% } %>' +
530 533 ' <% } %>' +
531 534 ' <% if (arrays || support.nonEnumArgs) { %>\n}<% } %>\n' +
@@ -586,16 +589,14 @@
586 589 index = fromIndex - 1;
587 590
588 591 while (++index < length) {
589   - // manually coerce `value` to a string because `hasOwnProperty`, in some
590   - // older versions of Firefox, coerces objects incorrectly
591   - var key = String(array[index]);
592   - (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
  592 + var key = keyPrefix + array[index];
  593 + (cache[key] || (cache[key] = [])).push(array[index]);
593 594 }
594 595 }
595 596 return function(value) {
596 597 if (isLarge) {
597   - var key = String(value);
598   - return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
  598 + var key = keyPrefix + value;
  599 + return cache[key] && indexOf(cache[key], value) > -1;
599 600 }
600 601 return indexOf(array, value, fromIndex) > -1;
601 602 }
@@ -754,22 +755,6 @@
754 755 }
755 756
756 757 /**
757   - * A function compiled to iterate `arguments` objects, arrays, objects, and
758   - * strings consistenly across environments, executing the `callback` for each
759   - * element in the `collection`. The `callback` is bound to `thisArg` and invoked
760   - * with three arguments; (value, index|key, collection). Callbacks may exit
761   - * iteration early by explicitly returning `false`.
762   - *
763   - * @private
764   - * @type Function
765   - * @param {Array|Object|String} collection The collection to iterate over.
766   - * @param {Function} [callback=identity] The function called per iteration.
767   - * @param {Mixed} [thisArg] The `this` binding of `callback`.
768   - * @returns {Array|Object|String} Returns `collection`.
769   - */
770   - var each = createIterator(eachIteratorOptions);
771   -
772   - /**
773 758 * Used by `template` to escape characters for inclusion in compiled
774 759 * string literals.
775 760 *
@@ -802,7 +787,7 @@
802 787 function isNode(value) {
803 788 // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
804 789 // methods that are `typeof` "string" and still can coerce nodes to strings
805   - return typeof value.toString != 'function' && typeof String(value) == 'string';
  790 + return typeof value.toString != 'function' && typeof (value + '') == 'string';
806 791 }
807 792
808 793 /**
@@ -845,7 +830,8 @@
845 830 }
846 831 // check that the constructor is `Object` (i.e. `Object instanceof Object`)
847 832 var ctor = value.constructor;
848   - if ((!isFunction(ctor) && (support.nodeClass || !isNode(value))) || ctor instanceof ctor) {
  833 +
  834 + if (isFunction(ctor) ? ctor instanceof ctor : (support.nodeClass || !isNode(value))) {
849 835 // IE < 9 iterates inherited properties before own properties. If the first
850 836 // iterated property is an object's own property then there are no inherited
851 837 // enumerable properties.
@@ -868,23 +854,6 @@
868 854 }
869 855
870 856 /**
871   - * A fallback implementation of `Object.keys` that produces an array of the
872   - * given object's own enumerable property names.
873   - *
874   - * @private
875   - * @type Function
876   - * @param {Object} object The object to inspect.
877   - * @returns {Array} Returns a new array of property names.
878   - */
879   - var shimKeys = createIterator({
880   - 'args': 'object',
881   - 'init': '[]',
882   - 'top': 'if (!(objectTypes[typeof object])) return result',
883   - 'loop': 'result.push(index)',
884   - 'arrays': false
885   - });
886   -
887   - /**
888 857 * Slices the `collection` from the `start` index up to, but not including,
889 858 * the `end` index.
890 859 *
@@ -974,6 +943,23 @@
974 943 };
975 944
976 945 /**
  946 + * A fallback implementation of `Object.keys` that produces an array of the
  947 + * given object's own enumerable property names.
  948 + *
  949 + * @private
  950 + * @type Function
  951 + * @param {Object} object The object to inspect.
  952 + * @returns {Array} Returns a new array of property names.
  953 + */
  954 + var shimKeys = createIterator({
  955 + 'args': 'object',
  956 + 'init': '[]',
  957 + 'top': 'if (!(objectTypes[typeof object])) return result',
  958 + 'loop': 'result.push(index)',
  959 + 'arrays': false
  960 + });
  961 +
  962 + /**
977 963 * Creates an array composed of the own enumerable property names of `object`.
978 964 *
979 965 * @static
@@ -998,6 +984,22 @@
998 984 };
999 985
1000 986 /**
  987 + * A function compiled to iterate `arguments` objects, arrays, objects, and
  988 + * strings consistenly across environments, executing the `callback` for each
  989 + * element in the `collection`. The `callback` is bound to `thisArg` and invoked
  990 + * with three arguments; (value, index|key, collection). Callbacks may exit
  991 + * iteration early by explicitly returning `false`.
  992 + *
  993 + * @private
  994 + * @type Function
  995 + * @param {Array|Object|String} collection The collection to iterate over.
  996 + * @param {Function} [callback=identity] The function called per iteration.
  997 + * @param {Mixed} [thisArg] The `this` binding of `callback`.
  998 + * @returns {Array|Object|String} Returns `collection`.
  999 + */
  1000 + var each = createIterator(eachIteratorOptions);
  1001 +
  1002 + /**
1001 1003 * Used to convert characters to HTML entities:
1002 1004 *
1003 1005 * Though the `>` character is escaped for symmetry, characters like `>` and `/`
@@ -2039,9 +2041,10 @@
2039 2041 ? (isArray(value) ? value : [])
2040 2042 : (isPlainObject(value) ? value : {});
2041 2043
  2044 + var isShallow;
2042 2045 if (callback) {
2043 2046 result = callback(value, source);
2044   - if (typeof result != 'undefined') {
  2047 + if ((isShallow = typeof result != 'undefined')) {
2045 2048 value = result;
2046 2049 }
2047 2050 }
@@ -2050,7 +2053,7 @@
2050 2053 stackB.push(value);
2051 2054
2052 2055 // recursively merge objects and arrays (susceptible to call stack limits)
2053   - if (!callback) {
  2056 + if (!isShallow) {
2054 2057 value = merge(value, source, indicatorObject, callback, stackA, stackB);
2055 2058 }
2056 2059 }
@@ -3622,8 +3625,8 @@
3622 3625 while (++index < length) {
3623 3626 var value = array[index];
3624 3627 if (isLarge) {
3625   - var key = String(value);
3626   - var inited = hasOwnProperty.call(cache[0], key)
  3628 + var key = keyPrefix + value;
  3629 + var inited = cache[0][key]
3627 3630 ? !(seen = cache[0][key])
3628 3631 : (seen = cache[0][key] = []);
3629 3632 }
@@ -4030,8 +4033,8 @@
4030 4033 computed = callback ? callback(value, index, array) : value;
4031 4034
4032 4035 if (isLarge) {
4033   - var key = String(computed);
4034   - var inited = hasOwnProperty.call(cache, key)
  4036 + var key = keyPrefix + computed;
  4037 + var inited = cache[key]
4035 4038 ? !(seen = cache[key])
4036 4039 : (seen = cache[key] = []);
4037 4040 }
@@ -4516,7 +4519,7 @@
4516 4519 function memoize(func, resolver) {
4517 4520 var cache = {};
4518 4521 return function() {
4519   - var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]);
  4522 + var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
4520 4523 return hasOwnProperty.call(cache, key)
4521 4524 ? cache[key]
4522 4525 : (cache[key] = func.apply(this, arguments));
@@ -5356,7 +5359,7 @@
5356 5359 * @memberOf _
5357 5360 * @type String
5358 5361 */
5359   - lodash.VERSION = '1.0.1';
  5362 + lodash.VERSION = '1.1.1';
5360 5363
5361 5364 // add "Chaining" functions to the wrapper
5362 5365 lodash.prototype.toString = wrapperToString;

0 comments on commit 0e63b6d

Please sign in to comment.
Something went wrong with that request. Please try again.