From 5d31338b027923017507a0afe972d2a73eef3f55 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 29 Oct 2013 01:14:12 -0700 Subject: [PATCH] Move `isV8` and `setImmediate` assignment after `nativeCreate` is assigned. --- dist/lodash.compat.js | 8 ++++---- dist/lodash.compat.min.js | 28 ++++++++++++++-------------- dist/lodash.js | 8 ++++---- dist/lodash.min.js | 26 +++++++++++++------------- lodash.js | 8 ++++---- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 098a6318a..fd5f63b80 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -528,10 +528,6 @@ setTimeout = context.setTimeout, splice = arrayRef.splice; - /** Used to detect `setImmediate` in Node.js */ - var isV8 = nativeCreate && !/\n/.test(nativeCreate) && !reNative.test(context.attachEvent), - setImmediate = typeof (setImmediate = isV8 && moduleExports && context.setImmediate) == 'function' && setImmediate; - /** Used to set meta data */ var defineProperty = (function() { // IE 8 only accepts DOM elements @@ -554,6 +550,10 @@ nativeParseInt = context.parseInt, nativeRandom = Math.random; + /** Used to detect `setImmediate` in Node.js */ + var isV8 = nativeCreate && !/\n/.test(nativeCreate) && !reNative.test(context.attachEvent), + setImmediate = typeof (setImmediate = isV8 && moduleExports && context.setImmediate) == 'function' && setImmediate; + /** Used to lookup a built-in constructor by [[Class]] */ var ctorByClass = {}; ctorByClass[arrayClass] = Array; diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index cf8afa86c..9a68b45c9 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -7,49 +7,49 @@ }}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(ee?0:e);++r=w&&f===n,h=u||g?i():c;if(g){var v=o(h);v?(f=t,h=v):(g=!1,h=u?h:(p(h),c))}for(;++af(h,y))&&((u||g)&&h.push(y),c.push(v))}return g?(p(h.k),s(h)):u&&p(h),c}function ct(n){return function(t,e,r){var u={};if(e=y.createCallback(e,r,3),qe(t)){r=-1;for(var o=t.length;++r=w&&f===n,h=u||g?i():c;if(g){var v=o(h);v?(f=t,h=v):(g=!1,h=u?h:(p(h),c))}for(;++af(h,y))&&((u||g)&&h.push(y),c.push(v))}return g?(p(h.k),s(h)):u&&p(h),c}function ct(n){return function(t,e,r){var u={};if(e=y.createCallback(e,r,3),qe(t)){r=-1;for(var o=t.length;++rk;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}"; r+="}"}return(e.b||Te.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(et,K,le,be,_,mt,qe,Ct,X.f,ce,Y,Le,H,pe,ge)}function gt(n){return He[n]}function ht(){var t=(t=y.indexOf)===zt?n:t;return t}function vt(n){var t,e;return!n||ge.call(n)!=J||(t=n.constructor,wt(t)&&!(t instanceof t))||!Te.argsClass&&mt(n)||!Te.nodeClass&&l(n)?!1:Te.ownLast?(nr(n,function(n,t,r){return e=be.call(r,t),!1}),false!==e):(nr(n,function(n,t){e=t}),typeof e=="undefined"||be.call(n,e))}function yt(n){return Ue[n] }function mt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ge.call(n)==L||!1}function dt(n,t,e){var r=We(n),u=r.length;for(t=et(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function _t(n){var t=[];return nr(n,function(n,e){wt(n)&&t.push(e)}),t.sort()}function bt(n){for(var t=-1,e=We(n),r=e.length,u={};++te?Be(0,o+e):e)||0,qe(n)?a=-1e?Ne(0,o+e):e)||0,qe(n)?a=-1o&&(o=i)}}else t=!t&&Ct(n)?r:y.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Pt(n,t,e,r){var u=3>arguments.length;if(t=et(t,r,4),qe(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++oarguments.length;return t=et(t,r,4),Dt(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Ft(n){var t=-1,e=n?n.length:0,r=Yt(typeof e=="number"?e:0); return At(n,function(n){var e=ft(0,++t);r[t]=r[e],r[e]=n}),r}function $t(n,t,e){var r;if(t=y.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e=w&&u===n;if(l){var c=o(i);c?(u=t,i=c):l=!1}for(;++ru(i,c)&&f.push(c);return l&&s(i),f}function Tt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=y.createCallback(t,e,3);++or?Be(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=y.createCallback(t,e,3);++u>>1,e(n[r])r?Ne(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=y.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:D,variable:"",imports:{_:y}},Se||(tt=function(n){if(jt(n)){c.prototype=n;var t=new c;c.prototype=null}return t||{}});var ze=Oe?function(n,t){Q.value=t,Oe(n,"__bindData__",Q)}:c;Te.argsClass||(mt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&be.call(n,"callee")||!1});var qe=Ie||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ge.call(n)==T||!1 -},Ke=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),We=Ne?function(n){return jt(n)?Te.enumPrototypes&&typeof n=="function"||Te.nonEnumArgs&&n.length&&mt(n)?Ke(n):Ne(n):[]}:Ke,Ge={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:We,g:"if(e(t[n],n,g)===false)return E"},Je={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b":">",'"':""","'":"'"},Ue=bt(He),Ve=oe("("+We(Ue).join("|")+")","g"),Qe=oe("["+We(He).join("")+"]","g"),Xe=st(Ge),Ye=st(Je,{i:Je.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Ze=st(Je),nr=st(Ge,Me,{j:!1}),tr=st(Ge,Me); -wt(/x/)&&(wt=function(n){return typeof n=="function"&&ge.call(n)==W});var er=_e?function(n){if(!n||ge.call(n)!=J||!Te.argsClass&&mt(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=_e(t))&&_e(e);return e?n==e||_e(n)==e:vt(n)}:vt,rr=ct(function(n,t,e){be.call(n,e)?n[e]++:n[e]=1}),ur=ct(function(n,t,e){(be.call(n,e)?n[e]:n[e]=[]).push(t)}),or=ct(function(n,t,e){n[e]=t}),ar=Nt;Ee&&(Ut=function(n){if(!wt(n))throw new ie;return Ee.apply(e,arguments)});var ir=8==Re(x+"08")?Re:function(n,t){return Re(Ct(n)?n.replace(N,""):n,t||0) +try{Te.nodeClass=!(ge.call(document)==J&&!({toString:0}+""))}catch(o){Te.nodeClass=!0}}(1),y.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:D,variable:"",imports:{_:y}},Oe||(tt=function(n){if(jt(n)){c.prototype=n;var t=new c;c.prototype=null}return t||{}});var ze=Ee?function(n,t){Q.value=t,Ee(n,"__bindData__",Q)}:c;Te.argsClass||(mt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&be.call(n,"callee")||!1});var qe=Se||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ge.call(n)==T||!1 +},Ke=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),We=De?function(n){return jt(n)?Te.enumPrototypes&&typeof n=="function"||Te.nonEnumArgs&&n.length&&mt(n)?Ke(n):De(n):[]}:Ke,Ge={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:We,g:"if(e(t[n],n,g)===false)return E"},Je={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b":">",'"':""","'":"'"},Ue=bt(He),Ve=oe("("+We(Ue).join("|")+")","g"),Qe=oe("["+We(He).join("")+"]","g"),Xe=st(Ge),Ye=st(Je,{i:Je.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Ze=st(Je),nr=st(Ge,Me,{j:!1}),tr=st(Ge,Me); +wt(/x/)&&(wt=function(n){return typeof n=="function"&&ge.call(n)==W});var er=_e?function(n){if(!n||ge.call(n)!=J||!Te.argsClass&&mt(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=_e(t))&&_e(e);return e?n==e||_e(n)==e:vt(n)}:vt,rr=ct(function(n,t,e){be.call(n,e)?n[e]++:n[e]=1}),ur=ct(function(n,t,e){(be.call(n,e)?n[e]:n[e]=[]).push(t)}),or=ct(function(n,t,e){n[e]=t}),ar=Nt;Fe&&(Ut=function(n){if(!wt(n))throw new ie;return Fe.apply(e,arguments)});var ir=8==Pe(x+"08")?Pe:function(n,t){return Pe(Ct(n)?n.replace(N,""):n,t||0) };return y.after=function(n,t){if(!wt(t))throw new ie;return function(){return 1>--n?t.apply(this,arguments):void 0}},y.assign=Ye,y.at=function(n){var t=arguments,e=-1,r=ut(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Yt(t);for(Te.unindexedChars&&Ct(n)&&(n=n.split(""));++e=w&&o(a?r[a]:v)}n:for(;++l(m?t(m,y):c(v,y))){for(a=u,(m||v).push(y);--a;)if(m=f[a],0>(m?t(m,y):c(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=f[u])&&s(m);return p(f),p(v),h},y.invert=bt,y.invoke=function(n,t){var e=g(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Yt(typeof o=="number"?o:0);return At(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},y.keys=We,y.map=Nt,y.max=Bt,y.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0]; return be.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!wt(n))throw new ie;return e.cache={},e},y.merge=function(n){var t=arguments,e=2;if(!jt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3r(a,e))&&(o[e]=n)}),o},y.once=function(n){var t,e;if(!wt(n))throw new ie;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},y.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Yt(r);++te?Be(0,r+e):Pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},y.mixin=Qt,y.noConflict=function(){return e._=se,this},y.parseInt=ir,y.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Fe(),Pe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ft(n,t) +},y.isElement=function(n){return n&&1===n.nodeType||!1},y.isEmpty=function(n){var t=!0;if(!n)return t;var e=ge.call(n),r=n.length;return e==T||e==H||(Te.argsClass?e==L:mt(n))||e==J&&typeof r=="number"&&wt(n.splice)?!r:(tr(n,function(){return t=!1}),t)},y.isEqual=function(n,t,e,r){return at(n,t,typeof e=="function"&&et(e,r,2))},y.isFinite=function(n){return Ie(n)&&!Ae(parseFloat(n))},y.isFunction=wt,y.isNaN=function(n){return xt(n)&&n!=+n},y.isNull=function(n){return null===n},y.isNumber=xt,y.isObject=jt,y.isPlainObject=er,y.isRegExp=function(n){return n&&Y[typeof n]&&ge.call(n)==M||!1 +},y.isString=Ct,y.isUndefined=function(n){return typeof n=="undefined"},y.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ne(0,r+e):Be(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},y.mixin=Qt,y.noConflict=function(){return e._=se,this},y.parseInt=ir,y.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Re(),Be(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ft(n,t) },y.reduce=Pt,y.reduceRight=Rt,y.result=function(n,t){if(n){var e=n[t];return wt(e)?n[t]():e}},y.runInContext=h,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},y.some=$t,y.sortedIndex=Kt,y.template=function(n,t,e){var r=y.templateSettings;n=ae(n||""),e=Ze({},e,r);var u,o=Ze({},e.imports,r.imports),r=We(o),o=kt(o),i=0,f=e.interpolate||B,l="__p+='",f=oe((e.escape||B).source+"|"+f.source+"|"+(f===D?S:B).source+"|"+(e.evaluate||B).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(i,c).replace(R,a),e&&(l+="'+__e("+e+")+'"),f&&(u=!0,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t }),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(C,""):l).replace(E,"$1").replace(O,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=te(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},y.unescape=function(n){return null==n?"":ae(n).replace(Ve,yt)},y.uniqueId=function(n){var t=++d;return ae(null==n?"":n)+t -},y.all=Ot,y.any=$t,y.detect=It,y.findWhere=It,y.foldl=Pt,y.foldr=Rt,y.include=Et,y.inject=Pt,tr(y,function(n,t){y.prototype[t]||(y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return je.apply(t,arguments),t=n.apply(y,t),e?new m(t,e):t})}),y.first=Tt,y.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return g(n,Be(0,u-r))},y.sample=function(n,t,e){return n&&typeof n.length!="number"?n=kt(n):Te.unindexedChars&&Ct(n)&&(n=n.split("")),null==t||e?n?n[ft(0,n.length-1)]:v:(n=Ft(n),n.length=Pe(Be(0,t),n.length),n) +},y.all=Ot,y.any=$t,y.detect=It,y.findWhere=It,y.foldl=Pt,y.foldr=Rt,y.include=Et,y.inject=Pt,tr(y,function(n,t){y.prototype[t]||(y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return je.apply(t,arguments),t=n.apply(y,t),e?new m(t,e):t})}),y.first=Tt,y.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return g(n,Ne(0,u-r))},y.sample=function(n,t,e){return n&&typeof n.length!="number"?n=kt(n):Te.unindexedChars&&Ct(n)&&(n=n.split("")),null==t||e?n?n[ft(0,n.length-1)]:v:(n=Ft(n),n.length=Be(Ne(0,t),n.length),n) },y.take=Tt,y.head=Tt,tr(y,function(n,t){var e="sample"!==t;y.prototype[t]||(y.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new m(o,u):o})}),y.VERSION="2.2.1",y.prototype.chain=function(){return this.__chain__=!0,this},y.prototype.toString=function(){return ae(this.__wrapped__)},y.prototype.value=Xt,y.prototype.valueOf=Xt,Xe(["join","pop","shift"],function(n){var t=fe[n];y.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); return n?new m(e,n):e}}),Xe(["push","reverse","sort","unshift"],function(n){var t=fe[n];y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(n){var t=fe[n];y.prototype[n]=function(){return new m(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Te.spliceObjects||Xe(["pop","shift","splice"],function(n){var t=fe[n],e="splice"==n;y.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new m(u,n):u }}),y}var v,y=[],m=[],d=0,_={},b=+new Date+"",w=75,j=40,x=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",C=/\b__p\+='';/g,E=/\b(__p\+=)''\+/g,O=/(__e\(.*?\)|\b__t\))\+'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,I=/\w*$/,A=/^function[ \n\r\t]+\w/,D=/<%=([\s\S]+?)%>/g,N=RegExp("^["+x+"]*0+(?=.$)"),B=/($^)/,P=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,F="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),$="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),L="[object Arguments]",T="[object Array]",z="[object Boolean]",q="[object Date]",K="[object Error]",W="[object Function]",G="[object Number]",J="[object Object]",M="[object RegExp]",H="[object String]",U={}; diff --git a/dist/lodash.js b/dist/lodash.js index 7164423e0..9a613e5e7 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -486,10 +486,6 @@ setTimeout = context.setTimeout, splice = arrayRef.splice; - /** Used to detect `setImmediate` in Node.js */ - var isV8 = nativeCreate && !/\n/.test(nativeCreate) && !reNative.test(context.attachEvent), - setImmediate = typeof (setImmediate = isV8 && moduleExports && context.setImmediate) == 'function' && setImmediate; - /** Used to set meta data */ var defineProperty = (function() { // IE 8 only accepts DOM elements @@ -512,6 +508,10 @@ nativeParseInt = context.parseInt, nativeRandom = Math.random; + /** Used to detect `setImmediate` in Node.js */ + var isV8 = nativeCreate && !/\n/.test(nativeCreate) && !reNative.test(context.attachEvent), + setImmediate = typeof (setImmediate = isV8 && moduleExports && context.setImmediate) == 'function' && setImmediate; + /** Used to lookup a built-in constructor by [[Class]] */ var ctorByClass = {}; ctorByClass[arrayClass] = Array; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 1e286f71d..383b1d57a 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -9,44 +9,44 @@ for(var r=-1,u=V[typeof n]&&We(n),o=u?u.length:0;++r=b&&f===n,h=u||v?a():s; +}),i&&!r&&d(n,function(n,t,e){return _e.call(e,t)?i=-1<--s:void 0}),p&&(c(u),c(o)),i}function at(n,t,e,r,u){(Be(t)?Et:y)(t,function(t,o){var i,a,f=t,l=n[o];if(t&&((a=Be(t))||g(t))){for(f=r.length;f--;)if(i=r[f]==t){l=u[f];break}if(!i){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=a?Be(l)?l:[]:g(l)?l:{}),r.push(t),u.push(l),c||at(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);n[o]=l})}function ft(n,t){return n+ge(Ae()*(t-n+1))}function lt(e,r,u){var i=-1,f=vt(),l=e?e.length:0,s=[],v=!r&&l>=b&&f===n,h=u||v?a():s; if(v){var g=o(h);g?(f=t,h=g):(v=!1,h=u?h:(c(h),s))}for(;++if(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={};e=Y.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++re?Se(0,o+e):e)||0,Be(n)?i=-1e?Ee(0,o+e):e)||0,Be(n)?i=-1o&&(o=a)}}else t=!t&&kt(n)?r:Y.createCallback(t,e,3),Et(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Dt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Yt(r);++earguments.length;t=ut(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;return t=ut(t,r,4),St(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Yt(typeof e=="number"?e:0);return Et(n,function(n){var e=ft(0,++t);r[t]=r[e],r[e]=n}),r}function Bt(n,t,e){var r; t=Y.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e=b&&u===n;if(l){var c=o(a);c?(u=t,a=c):l=!1}for(;++ru(a,c)&&f.push(c);return l&&p(a),f}function qt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=Y.createCallback(t,e,3);++or?Se(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Pt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Y.createCallback(t,e,3);++u>>1,e(n[r])r?Ee(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Pt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Y.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Y}},Ce||(rt=function(n){if(wt(n)){l.prototype=n;var t=new l;l.prototype=null}return t||{}});var Te=xe?function(n,t){U.value=t,xe(n,"__bindData__",U)}:l,Be=Oe||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&pe.call(n)==F||!1},We=Ee?function(n){return wt(n)?Ee(n):[]}:Q,qe={"&":"&","<":"<",">":">",'"':""","'":"'"},ze=bt(qe),Pe=oe("("+We(ze).join("|")+")","g"),Ke=oe("["+We(qe).join("")+"]","g"),Le=ct(function(n,t,e){_e.call(n,e)?n[e]++:n[e]=1 -}),Me=ct(function(n,t,e){(_e.call(n,e)?n[e]:n[e]=[]).push(t)}),Ue=ct(function(n,t,e){n[e]=t});ke&&(Ht=function(n){if(!dt(n))throw new ae;return ke.apply(e,arguments)});var Ve=8==Ae(w+"08")?Ae:function(n,t){return Ae(kt(n)?n.replace(E,""):n,t||0)};return Y.after=function(n,t){if(!dt(t))throw new ae;return function(){return 1>--n?t.apply(this,arguments):void 0}},Y.assign=J,Y.at=function(n){for(var t=arguments,e=-1,r=ot(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Yt(t);++e/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Y}},xe||(rt=function(n){if(wt(n)){l.prototype=n;var t=new l;l.prototype=null}return t||{}});var Te=ke?function(n,t){U.value=t,ke(n,"__bindData__",U)}:l,Be=Ce||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&pe.call(n)==F||!1},We=Ne?function(n){return wt(n)?Ne(n):[]}:Q,qe={"&":"&","<":"<",">":">",'"':""","'":"'"},ze=bt(qe),Pe=oe("("+We(ze).join("|")+")","g"),Ke=oe("["+We(qe).join("")+"]","g"),Le=ct(function(n,t,e){_e.call(n,e)?n[e]++:n[e]=1 +}),Me=ct(function(n,t,e){(_e.call(n,e)?n[e]:n[e]=[]).push(t)}),Ue=ct(function(n,t,e){n[e]=t});De&&(Ht=function(n){if(!dt(n))throw new ae;return De.apply(e,arguments)});var Ve=8==Re(w+"08")?Re:function(n,t){return Re(kt(n)?n.replace(E,""):n,t||0)};return Y.after=function(n,t){if(!dt(t))throw new ae;return function(){return 1>--n?t.apply(this,arguments):void 0}},Y.assign=J,Y.at=function(n){for(var t=arguments,e=-1,r=ot(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Yt(t);++e=b&&o(i?r[i]:g)}n:for(;++l(m?t(m,y):s(g,y))){for(i=u,(m||g).push(y);--i;)if(m=f[i],0>(m?t(m,y):s(r[i],y)))continue n;h.push(y)}}for(;u--;)(m=f[u])&&p(m);return c(f),c(g),h},Y.invert=bt,Y.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Yt(typeof o=="number"?o:0); +if(typeof t!="number"&&null!=t){var o=u;for(t=Y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Se(Ee(0,u-r),u))},Y.intersection=function(e){for(var r=arguments,u=r.length,i=-1,f=a(),l=-1,s=vt(),v=e?e.length:0,h=[],g=a();++i=b&&o(i?r[i]:g)}n:for(;++l(m?t(m,y):s(g,y))){for(i=u,(m||g).push(y);--i;)if(m=f[i],0>(m?t(m,y):s(r[i],y)))continue n;h.push(y)}}for(;u--;)(m=f[u])&&p(m);return c(f),c(g),h},Y.invert=bt,Y.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Yt(typeof o=="number"?o:0); return Et(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},Y.keys=We,Y.map=Rt,Y.max=At,Y.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):_+arguments[0];return _e.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!dt(n))throw new ae;return e.cache={},e},Y.merge=function(n){var t=arguments,e=2;if(!wt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3r(i,e))&&(o[e]=n)}),o},Y.once=function(n){var t,e;if(!dt(n))throw new ae;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e) }},Y.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Yt(r);++te?Se(0,r+e):Re(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Y.mixin=Qt,Y.noConflict=function(){return e._=ce,this},Y.parseInt=Ve,Y.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=De(),Re(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ft(n,t) +},Y.isElement=function(n){return n&&1===n.nodeType||!1},Y.isEmpty=function(n){var t=!0;if(!n)return t;var e=pe.call(n),r=n.length;return e==F||e==K||e==$||e==z&&typeof r=="number"&&dt(n.splice)?!r:(y(n,function(){return t=!1}),t)},Y.isEqual=function(n,t,e,r){return it(n,t,typeof e=="function"&&ut(e,r,2))},Y.isFinite=function(n){return Oe(n)&&!Ie(parseFloat(n))},Y.isFunction=dt,Y.isNaN=function(n){return jt(n)&&n!=+n},Y.isNull=function(n){return null===n},Y.isNumber=jt,Y.isObject=wt,Y.isPlainObject=g,Y.isRegExp=function(n){return n&&typeof n=="object"&&pe.call(n)==P||!1 +},Y.isString=kt,Y.isUndefined=function(n){return typeof n=="undefined"},Y.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ee(0,r+e):Se(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Y.mixin=Qt,Y.noConflict=function(){return e._=ce,this},Y.parseInt=Ve,Y.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Ae(),Se(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ft(n,t) },Y.reduce=$t,Y.reduceRight=Ft,Y.result=function(n,t){if(n){var e=n[t];return dt(e)?n[t]():e}},Y.runInContext=v,Y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},Y.some=Bt,Y.sortedIndex=Kt,Y.template=function(n,t,e){var r=Y.templateSettings;n=ie(n||""),e=G({},e,r);var u,o=G({},e.imports,r.imports),r=We(o),o=xt(o),a=0,f=e.interpolate||S,l="__p+='",f=oe((e.escape||S).source+"|"+f.source+"|"+(f===N?C:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(A,i),e&&(l+="'+__e("+e+")+'"),f&&(u=!0,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t }),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(j,""):l).replace(k,"$1").replace(x,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=te(r,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Y.unescape=function(n){return null==n?"":ie(n).replace(Pe,gt)},Y.uniqueId=function(n){var t=++m;return ie(null==n?"":n)+t -},Y.all=Ot,Y.any=Bt,Y.detect=Nt,Y.findWhere=Nt,Y.foldl=$t,Y.foldr=Ft,Y.include=Ct,Y.inject=$t,y(Y,function(n,t){Y.prototype[t]||(Y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return de.apply(t,arguments),t=n.apply(Y,t),e?new nt(t,e):t})}),Y.first=qt,Y.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=Y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Se(0,u-r))},Y.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=xt(n)),null==t||e?n?n[ft(0,n.length-1)]:h:(n=Tt(n),n.length=Re(Se(0,t),n.length),n) +},Y.all=Ot,Y.any=Bt,Y.detect=Nt,Y.findWhere=Nt,Y.foldl=$t,Y.foldr=Ft,Y.include=Ct,Y.inject=$t,y(Y,function(n,t){Y.prototype[t]||(Y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return de.apply(t,arguments),t=n.apply(Y,t),e?new nt(t,e):t})}),Y.first=qt,Y.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=Y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Ee(0,u-r))},Y.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=xt(n)),null==t||e?n?n[ft(0,n.length-1)]:h:(n=Tt(n),n.length=Se(Ee(0,t),n.length),n) },Y.take=qt,Y.head=qt,y(Y,function(n,t){var e="sample"!==t;Y.prototype[t]||(Y.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new nt(o,u):o})}),Y.VERSION="2.2.1",Y.prototype.chain=function(){return this.__chain__=!0,this},Y.prototype.toString=function(){return ie(this.__wrapped__)},Y.prototype.value=Xt,Y.prototype.valueOf=Xt,Et(["join","pop","shift"],function(n){var t=fe[n];Y.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); return n?new nt(e,n):e}}),Et(["push","reverse","sort","unshift"],function(n){var t=fe[n];Y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Et(["concat","slice","splice"],function(n){var t=fe[n];Y.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Y}var h,g=[],y=[],m=0,_=+new Date+"",b=75,d=40,w=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",j=/\b__p\+='';/g,k=/\b(__p\+=)''\+/g,x=/(__e\(.*?\)|\b__t\))\+'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,I=/^function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,E=RegExp("^["+w+"]*0+(?=.$)"),S=/($^)/,R=/\bthis\b/,A=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),$="[object Arguments]",F="[object Array]",T="[object Boolean]",B="[object Date]",W="[object Function]",q="[object Number]",z="[object Object]",P="[object RegExp]",K="[object String]",L={}; L[W]=!1,L[$]=L[F]=L[T]=L[B]=L[q]=L[z]=L[P]=L[K]=!0;var M={leading:!1,maxWait:0,trailing:!1},U={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},G={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},H=V[typeof window]&&window||this,J=V[typeof exports]&&exports&&!exports.nodeType&&exports,Q=V[typeof module]&&module&&!module.nodeType&&module,X=Q&&Q.exports===J&&J,Y=V[typeof global]&&global;!Y||Y.global!==Y&&Y.window!==Y||(H=Y); diff --git a/lodash.js b/lodash.js index 7b0d6d67a..97d3ef934 100644 --- a/lodash.js +++ b/lodash.js @@ -528,10 +528,6 @@ splice = arrayRef.splice, unshift = arrayRef.unshift; - /** Used to detect `setImmediate` in Node.js */ - var isV8 = nativeCreate && !/\n/.test(nativeCreate) && !reNative.test(context.attachEvent), - setImmediate = typeof (setImmediate = isV8 && moduleExports && context.setImmediate) == 'function' && setImmediate; - /** Used to set meta data */ var defineProperty = (function() { // IE 8 only accepts DOM elements @@ -554,6 +550,10 @@ nativeParseInt = context.parseInt, nativeRandom = Math.random; + /** Used to detect `setImmediate` in Node.js */ + var isV8 = nativeCreate && !/\n/.test(nativeCreate) && !reNative.test(context.attachEvent), + setImmediate = typeof (setImmediate = isV8 && moduleExports && context.setImmediate) == 'function' && setImmediate; + /** Used to lookup a built-in constructor by [[Class]] */ var ctorByClass = {}; ctorByClass[arrayClass] = Array;