From 83c6fb089e4612f85acabeec1f298e922f306808 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 11 Sep 2012 09:15:32 -0700 Subject: [PATCH] Ensure mobile build has properties correctly minified. Former-commit-id: 61da738afbcefc7ecd277190147041d884002af1 --- README.md | 2 +- build/pre-compile.js | 2 +- lodash.js | 2 +- lodash.min.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b2cc2c744..cd0b26894 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Lo-Dash has been tested in at least Chrome 5-21, Firefox 1-15, IE 6-9, Opera 9.2 ## Custom builds Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need. -To top it off, we handle all the method dependency and alias mapping for you. +To top it off, we handle all method dependency and alias mapping for you. * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. ```bash diff --git a/build/pre-compile.js b/build/pre-compile.js index 0a1a39962..08e0bef5d 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -322,7 +322,7 @@ properties.forEach(function(property, index) { var reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'), reDotProp = RegExp('\\.' + property + '\\b', 'g'), - rePropColon = RegExp("([^?])(')?\\b" + property + "\\2 *:", 'g'); + rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g'); if (isCompilable) { // add quotes around properties in the inlined `_.merge` and `_.sortBy` diff --git a/lodash.js b/lodash.js index 1d43c60cf..142ac2387 100644 --- a/lodash.js +++ b/lodash.js @@ -1825,7 +1825,7 @@ var merge = createIterator(extendIteratorOptions, { 'args': 'object, source, indicator', 'top': - 'var isArr, source, recursive = indicator == isPlainObject,\n' + + 'var isArr, recursive = indicator == isPlainObject,\n' + ' data = recursive ? arguments[3] : { values: [], sources: [] };\n' + 'for (var argsIndex = 1, argsLength = recursive ? 2 : arguments.length; argsIndex < argsLength; argsIndex++) {\n' + ' if (iteratee = arguments[argsIndex]) {', diff --git a/lodash.min.js b/lodash.min.js index 4488d6a1c..ead0d5489 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -22,7 +22,7 @@ RegExp("^"+(U.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/va ,">":">",""":'"',"'":"'"},Kt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var Gt={a:"d,c,y",j:"d",q:"if(!c)c=h;else if(y)c=k(c,y)",i:"if(c(A,i,d)===false)return u"},Yt={j:"{}",q:"var q;if(typeof c!='function'){var ii=c;c=function(A){return A[ii]}}else if(y)c=k(c,y)" ,i:"q=c(A,i,d);(g.call(u,q)?u[q]++:u[q]=1)"},Zt={j:"true",i:"if(!c(A,i,d))return!u"},en={r:i,s:i,a:"n",j:"n",q:"for(var a=1,b=arguments.length;a-1&&l===l>>>0&&T(A.splice)))return!l",i:{l:"return false"}}),gn=bt?function(e){var t=typeof e;return"function"==t&&ht.call(e,"prototype")?fn(e):e&&Kt[t]?bt(e):[]}:fn,yn=a(en,{a:"n,ee,O",q:"var Q,ee,dd=O==U,J=dd?arguments[3]:{g:[],d:[]};for(var a=1,b=dd?2:arguments.length;a-1&&l===l>>>0&&T(A.splice)))return!l",i:{l:"return false"}}),gn=bt?function(e){var t=typeof e;return"function"==t&&ht.call(e,"prototype")?fn(e):e&&Kt[t]?bt(e):[]}:fn,yn=a(en,{a:"n,ee,O",q:"var Q,dd=O==U,J=dd?arguments[3]:{g:[],d:[]};for(var a=1,b=dd?2:arguments.length;a-1"},i:"if(A===hh)return true"}),Tn=a(Gt,Yt),Nn=a(Gt,Zt),Cn=a(Gt,tn),kn=a(Gt,nn,{j:"",i:"if(c(A,i,d))return A"}),Ln=a(Gt,nn),An=a(Gt,Yt,{i:"q=c(A,i,d);(g.call(u,q)?u[q]:u[q]=[]).push(A)" }),On=a(sn,{a:"d,V",q:"var C=w.call(arguments,2),S=typeof V=='function'",i:{b:"u[i]=(S?V:A[V]).apply(A,C)",l:"u"+(zt?"[o]=":".push")+"((S?V:A[V]).apply(A,C))"}}),Mn=a(Gt,sn),_n=a(sn,{a:"d,bb",i:{b:"u[i]=A[bb]",l:"u"+(zt?"[o]=":".push")+"(A[bb])"}}),Dn=a({a:"d,c,B,y",j:"B",q:"var W=arguments.length<3;if(y)c=k(c,y)",d:{b:"if(W)u=j[++i]"},i:{b:"u=c(u,A,i,d)",l:"u=W?(W=false,A):c(u,A,i,d)"}}),Pn=a(Gt,tn,{i:"!"+tn.i}),Hn=a(Gt,Zt,{j:"false",i:Zt.i.replace("!","")}),Bn=a(Gt,Yt,sn,{i:{b:"u[i]={b:c(A,i,d),c:i,f:A}" ,l:"u"+(zt?"[o]=":".push")+"({b:c(A,i,d),c:i,f:A})"},e:"u.sort(I);l=u.length;while(l--)u[l]=u[l].f"}),jn=a(tn,{a:"d,aa",q:"var t=[];K(aa,function(A,q){t.push(q)});var cc=t.length",i:"for(var q,Z=true,s=0;s1){for(var i=1;ie?t():function(){if(1>--e)return t.apply