diff --git a/build.js b/build.js index 7c842bb3f..c37d4b359 100755 --- a/build.js +++ b/build.js @@ -367,8 +367,8 @@ // add `__chain__` checks to `_.mixin` source = source.replace(matchFunction(source, 'mixin'), function(match) { - return match.replace(/^ *return new lodash.+/m, function() { - var indent = getIndent(match); + return match.replace(/^( *)return new lodash.+/m, function() { + var indent = arguments[1]; return indent + [ '', 'var result = func.apply(lodash, args);', @@ -382,8 +382,7 @@ }); // replace wrapper `Array` method assignments - source = source.replace(/^(?: *\/\/.*\n)*( *)each\(\['[\s\S]+?\n\1}$/m, function(match) { - var indent = getIndent(match); + source = source.replace(/^(?: *\/\/.*\n)*( *)each\(\['[\s\S]+?\n\1}$/m, function(match, indent) { return indent + [ '// add `Array` mutator functions to the wrapper', "each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {", @@ -1227,9 +1226,10 @@ * @returns {String} Returns the modified source. */ function removeHasObjectSpliceBug(source) { - return removeVar(source, 'hasObjectSpliceBug') - // remove `hasObjectSpliceBug` fix from the `Array` function mixins - .replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?(?:{\s*}|\n\1})/, ''); + source = removeVar(source, 'hasObjectSpliceBug') + + // remove `hasObjectSpliceBug` fix from the `Array` function mixins + return source.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?(?:{\s*}|\n\1})/, ''); } /** @@ -1691,8 +1691,6 @@ }); } if (isUnderscore) { - source = removeFunction(source, 'runInContext'); - // replace `_.assign` source = replaceFunction(source, 'assign', [ 'function assign(object) {', @@ -2088,14 +2086,15 @@ ].join('\n')); // add `_.findWhere` - source = source.replace(matchFunction(source, 'find'), function (match) { + source = source.replace(matchFunction(source, 'find'), function(match) { + var indent = getIndent(match); return match + [ '', 'function findWhere(object, properties) {', ' return where(object, properties, true);', '}', '' - ].join('\n') + ].join('\n' + indent); }); source = source.replace(getMethodAssignments(source), function(match) { @@ -2223,11 +2222,12 @@ // inline all functions defined with `createIterator` _.functions(lodash).forEach(function(methodName) { // strip leading underscores to match pseudo private functions - var reFunc = RegExp('(^ *var ' + methodName.replace(/^_/, '') + ' *= *)createIterator\\(((?:{|[a-zA-Z])[\\s\\S]+?)\\);\\n'); + var reFunc = RegExp('^( *)(var ' + methodName.replace(/^_/, '') + ' *= *)createIterator\\(((?:{|[a-zA-Z])[\\s\\S]+?)\\);\\n', 'm'); if (reFunc.test(source)) { // extract, format, and inject the compiled function's source code - source = source.replace(reFunc, function(match, captured) { - return captured + getFunctionSource(lodash[methodName], getIndent(captured)) + ';\n'; + source = source.replace(reFunc, function(match, indent, left) { + return (indent + left) + + getFunctionSource(lodash[methodName], indent) + ';\n'; }); } }); @@ -2393,9 +2393,9 @@ // simplify the `lodash` function source = replaceFunction(source, 'lodash', [ - ' function lodash() {', - ' // no operation performed', - ' }' + 'function lodash() {', + ' // no operation performed', + '}' ].join('\n')); // remove all `lodash.prototype` additions @@ -2410,6 +2410,9 @@ source = removeVar(source, 'cloneableClasses'); source = removeVar(source, 'ctorByClass'); } + if (isRemoved(source, 'defer')) { + source = removeSetImmediate(source); + } if (isRemoved(source, 'isArray')) { source = removeVar(source, 'nativeIsArray'); } @@ -2440,7 +2443,6 @@ source = removeHasEnumPrototype(source); } if (isRemoved(source, 'createIterator', 'bind', 'keys')) { - source = removeSetImmediate(source); source = removeVar(source, 'isBindFast'); source = removeVar(source, 'isV8'); source = removeVar(source, 'nativeBind'); diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index ecd41c90a..7f48f5ac2 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -246,36 +246,6 @@ /*--------------------------------------------------------------------------*/ - /** Reusable iterator options for `assign` and `defaults` */ - var defaultsIteratorOptions = { - 'args': 'object, source, guard', - 'top': - 'var args = arguments,\n' + - ' argsIndex = 0,\n' + - " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + - 'while (++argsIndex < argsLength) {\n' + - ' iterable = args[argsIndex];\n' + - ' if (iterable && objectTypes[typeof iterable]) {', - 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", - 'bottom': ' }\n}' - }; - - /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ - var eachIteratorOptions = { - 'args': 'collection, callback, thisArg', - 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg)", - 'arrays': "typeof length == 'number'", - 'loop': 'if (callback(iterable[index], index, collection) === false) return result' - }; - - /** Reusable iterator options for `forIn` and `forOwn` */ - var forOwnIteratorOptions = { - 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, - 'arrays': false - }; - - /*--------------------------------------------------------------------------*/ - /** * Used by `_.max` and `_.min` as the default `callback` when a given * `collection` is a string value. @@ -430,54 +400,6 @@ return func; } - /** - * Creates compiled iteration functions. - * - * @private - * @param {Object} [options1, options2, ...] The compile options object(s). - * arrays - A string of code to determine if the iterable is an array or array-like. - * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. - * args - A string of comma separated arguments the iteration function will accept. - * top - A string of code to execute before the iteration branches. - * loop - A string of code to execute in the object loop. - * bottom - A string of code to execute after the iteration branches. - * - * @returns {Function} Returns the compiled function. - */ - function createIterator() { - var data = { - // support properties - - // iterator options - 'arrays': 'isArray(iterable)', - 'bottom': '', - 'loop': '', - 'top': '', - 'useHas': true - }; - - // merge options into a template data object - for (var object, index = 0; object = arguments[index]; index++) { - for (var key in object) { - data[key] = object[key]; - } - } - var args = data.args; - data.firstArg = /^[^,]+/.exec(args)[0]; - - // create the function factory - var factory = Function( - 'createCallback, hasOwnProperty, isArguments, isArray, isString, ' + - 'objectTypes, nativeKeys', - 'return function(' + args + ') {\n' + (data) + '\n}' - ); - // return the compiled function - return factory( - createCallback, hasOwnProperty, isArguments, isArray, isString, - objectTypes, nativeKeys - ); - } - /** * A function compiled to iterate `arguments` objects, arrays, objects, and * strings consistenly across environments, executing the `callback` for each @@ -492,7 +414,24 @@ * @param {Mixed} [thisArg] The `this` binding of `callback`. * @returns {Array|Object|String} Returns `collection`. */ - var each = createIterator(eachIteratorOptions); + var each = function (collection, callback, thisArg) { + var index, iterable = collection, result = iterable; + if (!iterable) return result; + callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg); + var length = iterable.length; index = -1; + if (typeof length == 'number') { + while (++index < length) { + if (callback(iterable[index], index, collection) === indicatorObject) return result + } + } + else { + for (index in iterable) { + if (hasOwnProperty.call(iterable, index)) { + if (callback(iterable[index], index, collection) === indicatorObject) return result; + } + } + } + }; /** * Used by `template` to escape characters for inclusion in compiled @@ -635,9 +574,17 @@ * }); * // => alerts 'name' and 'bark' (order is not guaranteed) */ - var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { - 'useHas': false - }); + var forIn = function (collection, callback) { + var index, iterable = collection, result = iterable; + if (!iterable) return result; + if (!objectTypes[typeof iterable]) return result; + callback || (callback = identity); + + for (index in iterable) { + if (callback(iterable[index], index, collection) === indicatorObject) return result; + } + return result + }; /** * Iterates over an object's own enumerable properties, executing the `callback` @@ -660,7 +607,19 @@ * }); * // => alerts '0', '1', and 'length' (order is not guaranteed) */ - var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + var forOwn = function (collection, callback) { + var index, iterable = collection, result = iterable; + if (!iterable) return result; + if (!objectTypes[typeof iterable]) return result; + callback || (callback = identity); + + for (index in iterable) { + if (hasOwnProperty.call(iterable, index)) { + if (callback(iterable[index], index, collection) === indicatorObject) return result; + } + } + return result + }; /** * Checks if `value` is an array. @@ -1796,10 +1755,10 @@ return result; } -function findWhere(object, properties) { - return where(object, properties, true); -} - + function findWhere(object, properties) { + return where(object, properties, true); + } + /** * Iterates over a `collection`, executing the `callback` for each element in * the `collection`. The `callback` is bound to `thisArg` and invoked with three @@ -3752,13 +3711,13 @@ function findWhere(object, properties) { lodash.prototype[methodName] = function() { var args = [this.__wrapped__]; push.apply(args, arguments); - - var result = func.apply(lodash, args); - if (this.__chain__) { - result = new lodash(result); - result.__chain__ = true; - } - return result; + + var result = func.apply(lodash, args); + if (this.__chain__) { + result = new lodash(result); + result.__chain__ = true; + } + return result; }; }); } diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 6cd68d713..37ba29e52 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -4,30 +4,31 @@ * Build: `lodash underscore -o ./dist/lodash.underscore.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(nr?0:r);++eu&&(u=a)}}else t=o(t,r),$t(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n) -});return u}function q(n,t,r,e){var u=3>arguments.length;if(t=o(t,e,4),Ct(n)){var i=-1,a=n.length;for(u&&(r=n[++i]);++iarguments.length;if(typeof u!="number")var a=Pt(n),u=a.length;return t=o(t,e,4),N(n,function(e,o,f){o=a?a[--u]:--u,r=i?(i=K,n[o]):t(r,n[o],o,f)}),r}function B(n,t,r){var e;if(t=o(t,r),Ct(n)){r=-1;for(var u=n.length;++rr?kt(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e>>1,r(n[e])z(f,c))&&(r&&f.push(c),a.push(e))}return a}function U(n,t){return It||Et&&2"']/g,et=/['\n\r\t\u2028\u2029\\]/g,ut="[object Arguments]",ot="[object Array]",it="[object Boolean]",at="[object Date]",ft="[object Number]",ct="[object Object]",lt="[object RegExp]",pt="[object String]",st={"boolean":K,"function":H,object:H,number:K,string:K,undefined:K},vt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},ht=[],X={},gt=n._,yt=RegExp("^"+(X.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),mt=Math.ceil,_t=n.clearTimeout,dt=ht.concat,bt=Math.floor,jt=X.hasOwnProperty,wt=ht.push,xt=n.setTimeout,At=X.toString,Et=yt.test(Et=l.bind)&&Et,Ot=yt.test(Ot=Array.isArray)&&Ot,Ft=n.isFinite,St=n.isNaN,Nt=yt.test(Nt=Object.keys)&&Nt,kt=Math.max,Rt=Math.min,qt=Math.random,X=!!n.attachEvent; -Function();var X=Et&&!/\n|true/.test(Et+X),It=Et&&!X,Bt=(Bt={0:1,length:1},ht.splice.call(Bt,0,1),Bt[0]),Dt=arguments.constructor==Object;r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var yt={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},Mt={l:"if(!r[typeof n])return u;"+yt.l,b:K},$t=i(yt);s(arguments)||(s=function(n){return n?jt.call(n,"callee"):K});var zt=i(yt,Mt,{m:K}),Tt=i(yt,Mt),Ct=Ot||function(n){return Dt&&n instanceof Array||At.call(n)==ot -},Pt=Nt?function(n){return j(n)?Nt(n):[]}:v,Ut={"&":"&","<":"<",">":">",'"':""","'":"'"},Vt=m(Ut);b(/x/)&&(b=function(n){return n instanceof Function||"[object Function]"==At.call(n)});var Wt=k;X&&Q&&typeof setImmediate=="function"&&(V=U(setImmediate,n)),r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.bind=U,r.bindAll=function(n){for(var t=dt.apply(ht,arguments),r=1z(e,o,r)&&u.push(o)}return u},r.filter=F,r.flatten=$,r.forEach=N,r.functions=y,r.groupBy=function(n,t,r){var e={};return t=o(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",(jt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=J){var i=u; -for(t=o(t,r);i--&&t(n[i],i,n);)e++}else e=t==J||r?1:t||e;return l(n,0,Rt(kt(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++ez(o,i)){for(var a=r;--a;)if(0>z(t[a],i))continue n;o.push(i)}}return o},r.invert=m,r.invoke=function(n,t){var r=l(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return N(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=Pt,r.map=k,r.max=R,r.memoize=function(n,t){var r={}; -return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return jt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.min=function(n,t,r){var e=1/0,u=e;if(!t&&Ct(n)){r=-1;for(var i=n.length;++rz(t,e,1)&&(r[e]=n) -}),r},r.once=function(n){var t,r;return function(){return t?r:(t=H,r=n.apply(this,arguments),n=J,r)}},r.pairs=function(n){for(var t=-1,r=Pt(n),e=r.length,u=Array(e);++tz(arguments,u,1)&&e.push(u)}return e},r.wrap=function(n,t){return function(){var r=[n]; -return wt.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?R(Wt(arguments,"length")):0,e=Array(r);++tr?kt(0,e+r):Rt(r,e-1))+1);e--;)if(n[e]===t)return e; -return-1},r.mixin=G,r.noConflict=function(){return n._=gt,this},r.random=function(n,t){return n==J&&t==J&&(t=1),n=+n||0,t==J&&(t=n,n=0),n+bt(qt()*((+t||0)-n+1))},r.reduce=q,r.reduceRight=I,r.result=function(n,t){var r=n?n[t]:J;return b(r)?n[t]():r},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Pt(n).length},r.some=B,r.sortedIndex=C,r.template=function(n,t,e){n||(n=""),e=g({},e,r.templateSettings);var u=0,o="__p+='",i=e.variable;n.replace(RegExp((e.escape||tt).source+"|"+(e.interpolate||tt).source+"|"+(e.evaluate||tt).source+"|$","g"),function(t,r,e,i,f){return o+=n.slice(u,f).replace(et,a),r&&(o+="'+_['escape']("+r+")+'"),i&&(o+="';"+i+";__p+='"),e&&(o+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t -}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var f=Function("_","return "+o)(r)}catch(c){throw c.source=o,c}return t?f(t):(f.source=o,f)},r.unescape=function(n){return n==J?"":(n+"").replace(nt,p)},r.uniqueId=function(n){var t=++Y+"";return n?n+t:t},r.all=O,r.any=B,r.detect=S,r.foldl=q,r.foldr=I,r.include=E,r.inject=q,r.first=M,r.last=function(n,t,r){if(n){var e=0,u=n.length; -if(typeof t!="number"&&t!=J){var i=u;for(t=o(t,r);i--&&t(n[i],i,n);)e++}else if(e=t,e==J||r)return n[u-1];return l(n,kt(0,u-e))}},r.take=M,r.head=M,r.chain=function(n){return n=new r(n),n.__chain__=H,n},r.VERSION="1.0.1",G(r),r.prototype.chain=function(){return this.__chain__=H,this},r.prototype.value=function(){return this.__wrapped__},$t("pop push reverse shift sort splice unshift".split(" "),function(n){var t=ht[n];r.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Bt&&0===n.length&&delete n[0],this -}}),$t(["concat","join","slice"],function(n){var t=ht[n];r.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new r(n),n.__chain__=H),n}}),L?Q?(Q.exports=r)._=r:L._=r:n._=r})(this); \ No newline at end of file +;(function(n,t){function r(n,t){var r;if(n&&vt[typeof n])for(r in t||(t=G),n)if(t(n[r],r,n)===nt)break}function e(n,t,r){if(n){t=t&&typeof r=="undefined"?t:a(t,r);var e=n.length;if(r=-1,typeof e=="number")for(;++rt||typeof n=="undefined")return 1;if(nr?0:r);++eo&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function I(n,t,r,u){var o=3>arguments.length;if(t=a(t,u,4),$t(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++iarguments.length;if(typeof u!="number")var i=zt(n),u=i.length;return t=a(t,e,4),k(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=L,n[a]):t(r,n[a],a,f)}),r}function D(n,t,r){var u; +if(t=a(t,r),$t(n)){r=-1;for(var o=n.length;++rr?Rt(0,u+r):r||0)-1;else if(r)return e=P(n,t),n[e]===t?e:-1;for(;++e>>1,r(n[e])T(f,c))&&(r&&f.push(c),i.push(e))}return i}function V(n,t){return Bt||Ot&&2"']/g,ut=/['\n\r\t\u2028\u2029\\]/g,ot="[object Arguments]",it="[object Array]",at="[object Boolean]",ft="[object Date]",ct="[object Number]",lt="[object Object]",pt="[object RegExp]",st="[object String]",vt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},ht={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},gt=[],Y={},yt=n._,mt=RegExp("^"+(Y.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),_t=Math.ceil,dt=n.clearTimeout,bt=gt.concat,jt=Math.floor,wt=Y.hasOwnProperty,At=gt.push,xt=n.setTimeout,Et=Y.toString,Ot=mt.test(Ot=p.bind)&&Ot,St=mt.test(St=Array.isArray)&&St,Ft=n.isFinite,Nt=n.isNaN,kt=mt.test(kt=Object.keys)&&kt,Rt=Math.max,qt=Math.min,It=Math.random,Y=!!n.attachEvent; +Function();var Y=Ot&&!/\n|true/.test(Ot+Y),Bt=Ot&&!Y,Dt=(Dt={0:1,length:1},gt.splice.call(Dt,0,1),Dt[0]),Mt=arguments.constructor==Object;u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},v(arguments)||(v=function(n){return n?wt.call(n,"callee"):L});var $t=St||function(n){return Mt&&n instanceof Array||Et.call(n)==it},zt=kt?function(n){return w(n)?kt(n):[]}:h,Tt={"&":"&","<":"<",">":">",'"':""","'":"'"},Ct=_(Tt); +j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==Et.call(n)});var Pt=R;Y&&X&&typeof setImmediate=="function"&&(W=V(setImmediate,n)),u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},u.bind=V,u.bindAll=function(n){for(var t=bt.apply(gt,arguments),r=1T(e,o,r)&&u.push(o)}return u},u.filter=F,u.flatten=z,u.forEach=k,u.functions=m,u.groupBy=function(n,t,r){var e={};return t=a(t,r),k(n,function(n,r,u){r=t(n,r,u)+"",(wt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},u.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==K||r?1:t||e;return p(n,0,qt(Rt(0,u-e),u))},u.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++eT(o,i)){for(var a=r;--a;)if(0>T(t[a],i))continue n; +o.push(i)}}return o},u.invert=_,u.invoke=function(n,t){var r=p(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return k(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},u.keys=zt,u.map=R,u.max=q,u.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return wt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},u.min=function(n,t,r){var u=1/0,o=u;if(!t&&$t(n)){r=-1;for(var i=n.length;++rT(t,r,1)&&(e[r]=n)}),e},u.once=function(n){var t,r;return function(){return t?r:(t=J,r=n.apply(this,arguments),n=K,r)}},u.pairs=function(n){for(var t=-1,r=zt(n),e=r.length,u=Array(e);++tT(arguments,u,1)&&e.push(u)}return e},u.wrap=function(n,t){return function(){var r=[n];return At.apply(r,arguments),t.apply(this,r)}},u.zip=function(n){for(var t=-1,r=n?q(Pt(arguments,"length")):0,e=Array(r);++tr?Rt(0,e+r):qt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=H,u.noConflict=function(){return n._=yt,this},u.random=function(n,t){return n==K&&t==K&&(t=1),n=+n||0,t==K&&(t=n,n=0),n+jt(It()*((+t||0)-n+1))},u.reduce=I,u.reduceRight=B,u.result=function(n,t){var r=n?n[t]:K; +return j(r)?n[t]():r},u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:zt(n).length},u.some=D,u.sortedIndex=P,u.template=function(n,t,r){n||(n=""),r=y({},r,u.templateSettings);var e=0,o="__p+='",i=r.variable;n.replace(RegExp((r.escape||rt).source+"|"+(r.interpolate||rt).source+"|"+(r.evaluate||rt).source+"|$","g"),function(t,r,u,i,a){return o+=n.slice(e,a).replace(ut,f),r&&(o+="'+_['escape']("+r+")+'"),i&&(o+="';"+i+";__p+='"),u&&(o+="'+((__t=("+u+"))==null?'':__t)+'"),e=a+t.length,t +}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var a=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},u.unescape=function(n){return n==K?"":(n+"").replace(tt,s)},u.uniqueId=function(n){var t=++Z+"";return n?n+t:t},u.all=S,u.any=D,u.detect=N,u.foldl=I,u.foldr=B,u.include=O,u.inject=I,u.first=$,u.last=function(n,t,r){if(n){var e=0,u=n.length; +if(typeof t!="number"&&t!=K){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[u-1];return p(n,Rt(0,u-e))}},u.take=$,u.head=$,u.chain=function(n){return n=new u(n),n.__chain__=J,n},u.VERSION="1.0.1",H(u),u.prototype.chain=function(){return this.__chain__=J,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var t=gt[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Dt&&0===n.length&&delete n[0],this +}}),e(["concat","join","slice"],function(n){var t=gt[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=J),n}}),Q?X?(X.exports=u)._=u:Q._=u:n._=u})(this); \ No newline at end of file diff --git a/test/test-build.js b/test/test-build.js index a1bea7bed..69b07ad38 100644 --- a/test/test-build.js +++ b/test/test-build.js @@ -1302,9 +1302,6 @@ if (!exposeAssign) { methodNames = _.without(methodNames, 'assign'); } - if (/utilities/.test(command) && /backbone|underscore/.test(command)) { - methodNames = _.without(methodNames, 'runInContext'); - } var lodash = context._ || {}; methodNames.forEach(function(methodName) { testMethod(lodash, methodName, basename);