From b01d50fe05414be7875fa4759331dfd73ebab80b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 8 Mar 2013 00:53:27 -0800 Subject: [PATCH] Add `_.support` unit tests and remove `_.support` from the `lodash underscore` build. Former-commit-id: 986c02d5363329f16cde720430b26edb6bc865f0 --- build.js | 3 +++ dist/lodash.underscore.js | 2 +- dist/lodash.underscore.min.js | 2 +- test/test-build.js | 1 + test/test.js | 31 ++++++++++++++++++++++++++++++- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/build.js b/build.js index fd3d5491a..fddb5edd4 100755 --- a/build.js +++ b/build.js @@ -2432,6 +2432,9 @@ }); }()); + // unexpose `lodash.support` + source = source.replace(/lodash\.support *= */, ''); + // remove `thisArg` from unexposed `forIn` and `forOwn` _.each([ { 'methodName': 'forIn', 'flag': exposeForIn }, diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 976596f38..274e5b583 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -188,7 +188,7 @@ * @memberOf _ * @type Object */ - var support = lodash.support = {}; + var support = {}; (function() { var object = { '0': 1, 'length': 1 }; diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 86b32c5a6..e8224690b 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -16,7 +16,7 @@ if(typeof u!="number")var i=It(n),u=i.length;return t=W(t,e,4),B(n,function(e,a, }}function T(n,t){for(var r=-1,e=n?n.length:0,u=[];++rr?Ft(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])z(a,f))&&(r&&a.push(f),i.push(e))}return i}function V(n,t){return Mt.fastBind||Et&&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]",st="[object RegExp]",pt="[object String]",vt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},gt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},ht=[],Y={},yt=n._,mt=RegExp("^"+(Y.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),_t=Math.ceil,dt=n.clearTimeout,bt=ht.concat,jt=Math.floor,wt=Y.hasOwnProperty,At=ht.push,xt=n.setTimeout,Ot=Y.toString,Et=mt.test(Et=s.bind)&&Et,St=mt.test(St=Array.isArray)&&St,Nt=n.isFinite,kt=n.isNaN,Bt=mt.test(Bt=Object.keys)&&Bt,Ft=Math.max,Rt=Math.min,qt=Math.random,Y=mt.test(n.attachEvent),Dt=Et&&!/\n|true/.test(Et+Y),Mt=u.support={}; +Y.global===Y&&(n=Y);var Z=0,nt={},tt=/&(?:amp|lt|gt|quot|#39);/g,rt=/($^)/,et=/[&<>"']/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]",st="[object RegExp]",pt="[object String]",vt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},gt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},ht=[],Y={},yt=n._,mt=RegExp("^"+(Y.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),_t=Math.ceil,dt=n.clearTimeout,bt=ht.concat,jt=Math.floor,wt=Y.hasOwnProperty,At=ht.push,xt=n.setTimeout,Ot=Y.toString,Et=mt.test(Et=s.bind)&&Et,St=mt.test(St=Array.isArray)&&St,Nt=n.isFinite,kt=n.isNaN,Bt=mt.test(Bt=Object.keys)&&Bt,Ft=Math.max,Rt=Math.min,qt=Math.random,Y=mt.test(n.attachEvent),Dt=Et&&!/\n|true/.test(Et+Y),Mt={}; (function(){var n={0:1,length:1};Mt.argsObject=arguments.constructor==Object,Mt.fastBind=Et&&!Dt,Mt.spliceObjects=(ht.splice.call(n,0,1),!n[0])})(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},c.prototype=u.prototype,v(arguments)||(v=function(n){return n?wt.call(n,"callee"):L});var $t=St||function(n){return Mt.argsObject&&n instanceof Array||Ot.call(n)==it},It=Bt?function(n){return w(n)?Bt(n):[]}:g,Tt={"&":"&","<":"<",">":">",'"':""","'":"'"},zt=_(Tt); j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==Ot.call(n)});var Ct=F;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(ht,arguments),r=1