From 23b8d083a409c84e58c916c84beac74896811a80 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 25 Apr 2012 14:19:44 -0400 Subject: [PATCH] lodash: Add spaces to compiled / template strings. [jddalton] Former-commit-id: e28bb94dfb8f315f62dd942765752739f30950dc --- build/pre-compile.js | 15 +++-- lodash.js | 148 +++++++++++++++++++++++-------------------- lodash.min.js | 18 +++--- 3 files changed, 98 insertions(+), 83 deletions(-) diff --git a/build/pre-compile.js b/build/pre-compile.js index ee992cc35..0ff0fe973 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -5,7 +5,7 @@ /** The Node filesystem module */ var fs = require('fs'); - /** Used to minify string literals embedded in compiled strings */ + /** Used to minify string values used by `iterationFactory` and its options */ var compiledValues = [ 'arrays', 'objects' @@ -114,6 +114,13 @@ // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export source = source.replace(RegExp('\\.(' + iterationFactoryOptions.concat(propWhitelist).join('|') + ')\\b', 'g'), "['$1']"); + // remove whitespace from string literals + source = source.replace(/'(?:(?=(\\?))\1.)*?'/g, function(string) { + return string.replace(/\[object |else if|function | in |return\s+[\w']|throw |use strict|var |'\\n'|\\n|\s+/g, function(match) { + return match == false || match == '\\n' ? '' : match; + }); + }); + // minify `sortBy` and `template` methods ['sortBy', 'template'].forEach(function(methodName) { var properties = ['criteria', 'value'], @@ -125,9 +132,6 @@ result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'"); }); - // remove escaped newlines in strings - result = result.replace(/\\n/g, ''); - // replace with modified snippet source = source.replace(snippet, result); }); @@ -186,9 +190,6 @@ } }); - // remove escaped newlines in strings - result = result.replace(/\\n/g, ''); - // replace with modified snippet source = source.replace(snippet, result); }); diff --git a/lodash.js b/lodash.js index ab502734e..d3ec738d8 100644 --- a/lodash.js +++ b/lodash.js @@ -81,24 +81,26 @@ /** Compilation options for `_.difference` */ var differenceFactoryOptions = { 'args': 'array', - 'top': 'var values=concat.apply([],slice.call(arguments,1))', + 'top': 'var values = concat.apply([], slice.call(arguments, 1))', 'init': '[]', - 'inLoop': 'if(indexOf(values,array[index])<0)result.push(array[index])' + 'inLoop': 'if (indexOf(values, array[index]) < 0) result.push(array[index])' }; /** Compilation options for `_.every` */ var everyFactoryOptions = { 'init': 'true', - 'inLoop': 'if(!callback(collection[index],index,collection))return !result' + 'inLoop': 'if (!callback(collection[index], index, collection)) return !result' }; /** Compilation options for `_.extend` */ var extendFactoryOptions = { 'args': 'object', 'init': 'object', - 'beforeLoop': 'for(var source,j=1,length=arguments.length;j=computed)computed=current,result=collection[index]' + 'current = callback' + + '? callback(collection[index], index, collection)' + + ': collection[index];\n' + + 'if (current >= computed)' + + 'computed = current, result = collection[index]' }; /*--------------------------------------------------------------------------*/ @@ -221,9 +232,9 @@ var isEmpty = iterationFactory({ 'args': 'value', 'iterate': 'objects', - 'top': 'var className=toString.call(value)', + 'top': 'var className = toString.call(value)', 'init': 'true', - 'beforeLoop': 'if(className==arrayClass||className==stringClass)return !value.length', + 'beforeLoop': 'if (className == arrayClass || className == stringClass) return !value.length', 'inLoop': 'return false' }); @@ -269,29 +280,30 @@ useHas = options.useHas !== false; // stings used to compile methods are minified during the build process - return Function('arrayClass,bind,concat,funcClass,hasOwnProperty,identity,' + - 'indexOf,Infinity,isArray,isEmpty,Math,slice,stringClass,' + - 'toString,undefined', + return Function('arrayClass, bind, concat, funcClass, hasOwnProperty, identity,' + + 'indexOf, Infinity, isArray, isEmpty, Math, slice, stringClass,' + + 'toString, undefined', // compile the function in strict mode '"use strict";' + // compile the arguments the function accepts - 'return function(' + args + '){\n' + + 'return function(' + args + ') {\n' + // add code to the top of the iteration method (options.top || '') + ';\n' + // assign the `result` variable an initial value ('var index, result' + (init ? '=' + init : '')) + ';\n' + // exit early if the first argument, e.g. `collection`, is nullish - 'if(' + firstArg + '==undefined)return ' + (options.exits || 'result') + ';\n' + + 'if (' + firstArg + ' == undefined) return ' + (options.exits || 'result') + ';\n' + // the following branch is for iterating arrays and array-like objects (arrayBranch // initialize `length` and `index` variables - ? 'var length=' + firstArg + '.length;\nindex=-1;\n' + + ? 'var length = ' + firstArg + '.length;\n' + + 'index = -1;\n' + // check if the `collection` is array-like when there is an object iteration branch - ((objectBranch ? 'if(length===+length){\n' : '') + + ((objectBranch ? 'if (length === +length) {\n' : '') + // add code before the while-loop (array.beforeLoop || '') + ';\n' + // add a custom loop expression - 'while(' + (array.loopExp || '++index true */ var contains = iterationFactory({ - 'args': 'collection,target', + 'args': 'collection, target', 'init': 'false', - 'inLoop': 'if(collection[index]===target)return true' + 'inLoop': 'if (collection[index] === target) return true' }); /** @@ -431,7 +443,7 @@ * // => 2 */ var find = iterationFactory(forEachFactoryOptions, { - 'inLoop': 'if(callback(collection[index],index,collection))return collection[index]' + 'inLoop': 'if (callback(collection[index], index, collection)) return collection[index]' }); /** @@ -483,11 +495,13 @@ var groupBy = iterationFactory(forEachFactoryOptions, { 'init': '{}', 'beforeLoop': - 'var prop,isFunc=toString.call(callback)==funcClass;\n' + - 'if(isFunc&&thisArg)callback=bind(callback,thisArg)', + 'var prop, isFunc = toString.call(callback) == funcClass;\n' + + 'if (isFunc && thisArg) callback = bind(callback, thisArg)', 'inLoop': - 'prop=isFunc?callback(collection[index],index,collection):collection[index][callback];\n' + - '(result[prop]||(result[prop]=[])).push(collection[index])' + 'prop = isFunc' + + '? callback(collection[index], index, collection)' + + ': collection[index][callback];\n' + + '(result[prop] || (result[prop] = [])).push(collection[index])' }); /** @@ -507,13 +521,13 @@ * // => [[1, 5, 7], [1, 2, 3]] */ var invoke = iterationFactory(mapFactoryOptions, { - 'args': 'collection,methodName', - 'top': 'var args=slice.call(arguments,2),isFunc=toString.call(methodName)==funcClass', + 'args': 'collection, methodName', + 'top': 'var args = slice.call(arguments, 2), isFunc = toString.call(methodName) == funcClass', 'inLoop': (function() { - var value = '(isFunc?methodName:collection[index][methodName]).apply(collection[index],args)'; + var value = '(isFunc ? methodName : collection[index][methodName]).apply(collection[index], args)'; return { - 'array': 'result[index]=' + value, - 'object': 'result[result.length]=' + value + 'array': 'result[index] = ' + value, + 'object': 'result[result.length] = ' + value }; }()) }); @@ -614,10 +628,10 @@ * // => ['moe', 'larry', 'curly'] */ var pluck = iterationFactory(mapFactoryOptions, { - 'args': 'collection,property', + 'args': 'collection, property', 'inLoop': { - 'array': 'result[index]=collection[index][property]', - 'object': 'result[result.length]=collection[index][property]' + 'array': 'result[index] = collection[index][property]', + 'object': 'result[result.length] = collection[index][property]' } }); @@ -645,22 +659,22 @@ */ var reduce = iterationFactory({ 'args': - 'collection,callback,accumulator,thisArg', + 'collection, callback, accumulator, thisArg', 'top': - 'var initial=arguments.length>2;\n' + - 'if(thisArg)callback=bind(callback,thisArg)', + 'var initial = arguments.length > 2;\n' + + 'if (thisArg) callback = bind(callback, thisArg)', 'init': 'accumulator', 'beforeLoop': { - 'array': 'if(!initial)result=collection[++index]' + 'array': 'if (!initial) result = collection[++index]' }, 'inLoop': { 'array': - 'result=callback(result,collection[index],index,collection)', + 'result = callback(result, collection[index], index, collection)', 'object': - 'result=initial\n' + - '?callback(result,collection[index],index,collection)\n' + - ':(initial=true,collection[index])' + 'result = initial\n' + + '? callback(result, collection[index], index, collection)\n' + + ': (initial = true, collection[index])' } }); @@ -934,8 +948,8 @@ var values = iterationFactory(mapFactoryOptions, { 'args': 'collection', 'inLoop': { - 'array': 'result[index]=collection[index]', - 'object': 'result[result.length]=collection[index]' + 'array': 'result[index] = collection[index]', + 'object': 'result[result.length] = collection[index]' } }); @@ -958,7 +972,7 @@ var compact = iterationFactory({ 'args': 'array', 'init': '[]', - 'inLoop': 'if(array[index])result.push(array[index])' + 'inLoop': 'if (array[index]) result.push(array[index])' }); /** @@ -1310,7 +1324,7 @@ * // => [2, 3, 4] */ var without = iterationFactory(differenceFactoryOptions, { - 'top': 'var values=slice.call(arguments,1)', + 'top': 'var values = slice.call(arguments, 1)', 'init': '[]' }); @@ -1722,7 +1736,7 @@ * // => { 'flavor': 'chocolate', 'sprinkles': 'lots' } */ var defaults = iterationFactory(extendFactoryOptions, { - 'inLoop': 'if(object[index]==undefined)' + extendFactoryOptions.inLoop + 'inLoop': 'if (object[index] == undefined)' + extendFactoryOptions.inLoop }); /** @@ -1760,7 +1774,7 @@ var functions = iterationFactory(keysFactoryOptions, { 'top': '', 'useHas': false, - 'inLoop': 'if(toString.call(object[index])==funcClass)result.push(index)', + 'inLoop': 'if (toString.call(object[index]) == funcClass) result.push(index)', 'returns': 'result.sort()' }); @@ -2505,11 +2519,11 @@ // if a variable is not specified, place data values in local scope if (!options.variable) { - source = 'with(object||{}){\n' + source + '\n}\n'; + source = 'with (object || {}) {\n' + source + '\n}\n'; } - source = 'var __t,__j=Array.prototype.join,__p="";' + - 'function print(){__p+=__j.call(arguments,"")}\n' + + source = 'var __t, __j = Array.prototype.join, __p = "";' + + 'function print() { __p += __j.call(arguments, "") }\n' + source + 'return __p'; var render = Function(options.variable || 'object', '_', source); diff --git a/lodash.min.js b/lodash.min.js index 581b3f078..bfe45d250 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -3,24 +3,24 @@ Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE */ ;(function(q,h){"use strict";var n=!0,o=!1;function R(a){return"[object Arguments]"==k.call(a)}function i(a){return new p(a)}function p(a){this.o=a}function g(){for(var a,b=-1,c={},d={},e={},f=["d","j","g","a"];++b>1;c(a[f])a.length&&(b=n);J(c,function(c,f,j){if(b?ha(c)!==f||!c.length:0>D(c,f))c.push(f),d.push(a[j]); return c},[]);return d}function s(a,b){var c=m.call(arguments,2),d=c.length;return function(){c.length=d;G.apply(c,arguments);return a.apply(b,c)}}function ja(a,b,c){var d;return function(){var e=arguments,f=this;c&&!d&&a.apply(f,e);va(d);d=K(function(){d=h;c||a.apply(f,e)},b)}}function Y(a,b,c){c||(c=[]);if(a===b)return 0!==a||1/a==1/b;if(a==h||b==h)return a===b;a.p&&(a=a.o);b.p&&(b=b.o);if(a.isEqual&&t(a.isEqual))return a.isEqual(b);if(b.isEqual&&t(b.isEqual))return b.isEqual(a);var d=k.call(a); if(d!=k.call(b))return o;switch(d){case F:return a==""+b;case L:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ka:case la:return+a==+b;case ma:return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return o;for(var e=c.length;e--;)if(c[e]==a)return n;var e=n,f=0;c.push(a);if(d==B){if(f=a.length,e=f==b.length)for(;f--&&(e=f in a==f in b&&Y(a[f],b[f],c)););}else{if("constructor"in a!="constructor"in b||a.constructor!= b.constructor)return o;for(var j in a)if(r.call(a,j)&&(f++,!(e=r.call(b,j)&&Y(a[j],b[j],c))))break;if(e){for(j in b)if(r.call(b,j)&&!f--)break;e=!f}}c.pop();return e}function t(a){return k.call(a)==ba}function S(a){return a}function na(a){u(M(a),function(b){var c=i[b]=a[b];i.prototype[b]=function(){var a=[this.o];G.apply(a,arguments);a=c.apply(i,a);return this.p?(new p(a)).chain():a}})}var y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};(function(){for(var a in y)y[y[a]]= a})();var Z="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(q=global),exports),wa=0,xa=q._,ya=/\\|'|\r|\n|\t|\u2028|\u2029/g,$=/.^/,ua=/\\(\\|'|r|n|t|u2028|u2029)/g,B="[object Array]",ka="[object Boolean]",la="[object Date]",ba="[object Function]",L="[object Number]",ma="[object RegExp]",F="[object String]",z=Array.prototype,N=Object.prototype,C=z.concat,r=N.hasOwnProperty,G=z.push,m=z.slice,k=N.toString,za=q.isFinite,N=Object.keys,va=q.clearTimeout,K= -q.setTimeout,O={b:"c",m:"var M=j.apply([],D.call(arguments,1))",h:"[]",g:"if(q(M,c[p])<0)C.push(c[p])"},v={h:"J",g:"if(!f(h[p],p,h))return !C"},aa={b:"x",h:"x",d:"for(var E,j=1,w=arguments.length;j=i)i=k,C=h[p]"},E=Array.isArray||function(a){return k.call(a)==B},ca=g({b:"L",i:"b",m:"var g=I.call(L)",h:"J",d:"if(g==d||g==F)return !L.length",g:"return l"}),pa=g({b:"h,G",h:"l",g:"if(h[p]===G)return J"}),X=g(l,v),W=g(l,A),qa=g(l,{g:"if(f(h[p],p,h))return h[p]"}),u=g(l),Aa=g(l,{h:"{}",d:"var A,v=I.call(f)==m;if(v&&H)f=e(f,H)", -g:"A=v?f(h[p],p,h):h[p][f];(C[A]||(C[A]=[])).push(h[p])"}),Ba=g(w,{b:"h,z",m:"var b=D.call(arguments,2),v=I.call(z)==m",g:{c:"C[p]=(v?z:h[p][z]).apply(h[p],b)",k:"C[C.length]=(v?z:h[p][z]).apply(h[p],b)"}}),I=g(l,w),ra=g(l,x),x=g(l,x,{m:x.m.replace("-","").replace("max","min"),g:x.g.replace(">=","<")}),P=g(w,{b:"h,B",g:{c:"C[p]=h[p][B]",k:"C[C.length]=h[p][B]"}}),J=g({b:"h,f,a,H",m:"var s=arguments.length>2;if(H)f=e(f,H)",h:"a",d:{c:"if(!s)C=h[++p]"},g:{c:"C=f(C,h[p],p,h)",k:"C=s?f(C,h[p],p,h):(s=J,h[p])"}}), -A=g(l,A,{g:"!"+A.g}),v=g(l,v,{h:"l",g:v.g.replace("!","")}),sa=g(w,{b:"h",g:{c:"C[p]=h[p]",k:"C[C.length]=h[p]"}}),w=g({b:"c",h:"[]",g:"if(c[p])C.push(c[p])"}),l=g(O),O=g(O,{m:"var M=D.call(arguments,1)",h:"[]"}),ta=g(aa,{g:"if(x[p]==K)"+aa.g}),Q=g(aa),M=g(oa,{m:"",n:o,g:"if(I.call(x[p])==m)C.push(p)",l:"C.sort()"});R(arguments)||(R=function(a){return!(!a||!r.call(a,"callee"))});var U=N||g(oa);Q(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g}, -after:function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this,arguments)}},bind:s,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=M(a));for(var d=b.length;c/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},every:X,extend:Q,filter:W,find:qa,first:V,flatten:fa,forEach:u,functions:M,groupBy:Aa,has:function(a,b){return r.call(a,b)},identity:S,indexOf:D,initial:function(a,b, -c){return m.call(a,0,-(b==h||c?1:b))},intersection:ga,invoke:Ba,isArguments:R,isArray:E,isBoolean:function(a){return a===n||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:ca,isEqual:Y,isFinite:function(a){return za(a)&&k.call(a)==L},isFunction:t,isNaN:function(a){return k.call(a)==L&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==L},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)== +q.setTimeout,O={b:"c",m:"var M=j.apply([],D.call(arguments,1))",h:"[]",g:"if(q(M,c[p])<0)C.push(c[p])"},v={h:"J",g:"if(!f(h[p],p,h))return!C"},aa={b:"x",h:"x",d:"for(var E,j=1,w=arguments.length;j=i)i=k,C=h[p]"},E=Array.isArray||function(a){return k.call(a)==B},ca=g({b:"L",i:"b",m:"var g=I.call(L)",h:"J",d:"if(g==d||g==F)return!L.length",g:"return l"}),pa=g({b:"h,G",h:"l",g:"if(h[p]===G)return J"}),X=g(l,v),W=g(l,A),qa=g(l,{g:"if(f(h[p],p,h))return h[p]"}),u=g(l),Aa=g(l,{h:"{}",d:"var A,v=I.call(f)==m;if(v&&H)f=e(f,H)",g:"A=v?f(h[p],p,h):h[p][f];(C[A]||(C[A]=[])).push(h[p])"}), +Ba=g(w,{b:"h,z",m:"var b=D.call(arguments,2),v=I.call(z)==m",g:{c:"C[p]=(v?z:h[p][z]).apply(h[p],b)",k:"C[C.length]=(v?z:h[p][z]).apply(h[p],b)"}}),I=g(l,w),ra=g(l,x),x=g(l,x,{m:x.m.replace("-","").replace("max","min"),g:x.g.replace(">=","<")}),P=g(w,{b:"h,B",g:{c:"C[p]=h[p][B]",k:"C[C.length]=h[p][B]"}}),J=g({b:"h,f,a,H",m:"var s=arguments.length>2;if(H)f=e(f,H)",h:"a",d:{c:"if(!s)C=h[++p]"},g:{c:"C=f(C,h[p],p,h)",k:"C=s?f(C,h[p],p,h):(s=J,h[p])"}}),A=g(l,A,{g:"!"+A.g}),v=g(l,v,{h:"l",g:v.g.replace("!", +"")}),sa=g(w,{b:"h",g:{c:"C[p]=h[p]",k:"C[C.length]=h[p]"}}),w=g({b:"c",h:"[]",g:"if(c[p])C.push(c[p])"}),l=g(O),O=g(O,{m:"var M=D.call(arguments,1)",h:"[]"}),ta=g(aa,{g:"if(x[p]==K)"+aa.g}),Q=g(aa),M=g(oa,{m:"",n:o,g:"if(I.call(x[p])==m)C.push(p)",l:"C.sort()"});R(arguments)||(R=function(a){return!(!a||!r.call(a,"callee"))});var U=N||g(oa);Q(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},after:function(a,b){return 1>a?b(): +function(){if(1>--a)return b.apply(this,arguments)}},bind:s,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=M(a));for(var d=b.length;c/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},every:X,extend:Q,filter:W,find:qa,first:V,flatten:fa,forEach:u,functions:M,groupBy:Aa,has:function(a,b){return r.call(a,b)},identity:S,indexOf:D,initial:function(a,b,c){return m.call(a, +0,-(b==h||c?1:b))},intersection:ga,invoke:Ba,isArguments:R,isArray:E,isBoolean:function(a){return a===n||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:ca,isEqual:Y,isFinite:function(a){return za(a)&&k.call(a)==L},isFunction:t,isNaN:function(a){return k.call(a)==L&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==L},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)== ma},isString:function(a){return k.call(a)==F},isUndefined:function(a){return a===h},keys:U,last:ha,lastIndexOf:function(a,b){if(a==h)return-1;for(var c=a.length;c--;)if(a[c]===b)return c;return-1},map:I,max:ra,memoize:function(a,b){var c={};return function(){var d=b?b.apply(this,arguments):arguments[0];return r.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},min:x,mixin:na,noConflict:function(){q._=xa;return this},once:function(a){var b,c=o;return function(){if(c)return b;c=n;return b=a.apply(this, arguments)}},pick:function(a){for(var b,c=-1,d=C.apply([],m.call(arguments,1)),e=d.length,f={};++carguments.length&&(b=a||0,a=0);for(var d=-1,e=Math.max(Math.ceil((b-a)/c),0),f=Array(e);++dd?1:0}),"b")},sortedIndex:ea,tap:function(a,b){b(a);return a},template:function(a,b,c){function d(a){return e.call(this,a,i)}c=ta(c||{},i.templateSettings);a="__p+='"+a.replace(ya,function(a){return"\\"+ -y[a]}).replace(c.escape||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':__t)+'"}).replace(c.evaluate||$,function(a,b){return"';"+T(b)+";__p+='"})+"';";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",e=Function(c.variable||"object","_",a);if(b)return e(b,i);d.source="function("+(c.variable||"object")+ +y[a]}).replace(c.escape||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':__t)+'"}).replace(c.evaluate||$,function(a,b){return"';"+T(b)+";__p+='"})+"';\n";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",e=Function(c.variable||"object","_",a);if(b)return e(b,i);d.source="function("+(c.variable||"object")+ "){"+a+"}";return d},throttle:function(a,b){var c,d,e,f,g,i,k=ja(function(){d=g=o},b);return function(){c=arguments;f=this;i||(i=K(function(){i=h;d&&a.apply(f,c);k()},b));g?d=n:e=a.apply(f,c);k();g=n;return e}},times:function(a,b,c){c&&(b=s(b,c));for(c=0;c