diff --git a/underscore-min.js b/underscore-min.js index 0e6235f5d..dcc64d912 100644 --- a/underscore-min.js +++ b/underscore-min.js @@ -1 +1 @@ -(function(){var c=this;var e=c._;var g=function(h){this._wrapped=h};var f=typeof StopIteration!=="undefined"?StopIteration:"__break__";var d=c._=function(h){return new g(h)};if(typeof exports!=="undefined"){exports._=d}d.VERSION="0.4.3";d.each=function(q,o,n){var j=0;try{if(q.forEach){q.forEach(o,n)}else{if(q.length){for(var m=0,h=q.length;m=h.computed&&(h={value:q,computed:o})});return h.value};d.min=function(m,k,j){if(!k&&d.isArray(m)){return Math.min.apply(Math,m)}var h={computed:Infinity};d.each(m,function(q,n,p){var o=k?k.call(j,q,n,p):q;om?1:0}),"value")};d.sortedIndex=function(o,n,k){k=k||d.identity;var h=0,m=o.length;while(h>1;k(o[j])=0})})};d.zip=function(){var h=d.toArray(arguments);var m=d.max(d.pluck(h,"length"));var k=new Array(m);for(var j=0;j=0;j--){arguments=[h[j].apply(this,arguments)]}return arguments[0]}};d.keys=function(h){return d.map(h,function(k,j){return j})};d.values=function(h){return d.map(h,d.identity)};d.extend=function(h,k){for(var j in k){h[j]=k[j]}return h};d.clone=function(h){if(d.isArray(h)){return h.slice(0)}return d.extend({},h)};d.isEqual=function(j,h){if(j===h){return true}var n=typeof(j),p=typeof(h);if(n!=p){return false}if(j==h){return true}if(j.isEqual){return j.isEqual(h)}if(n!=="object"){return false}var k=d.keys(j),o=d.keys(h);if(k.length!=o.length){return false}for(var m in j){if(!d.isEqual(j[m],h[m])){return false}}return true};d.isEmpty=function(h){return(d.isArray(h)?h:d.values(h)).length==0};d.isElement=function(h){return !!(h&&h.nodeType==1)};d.isArray=function(h){return Object.prototype.toString.call(h)=="[object Array]"};d.isFunction=function(h){return Object.prototype.toString.call(h)=="[object Function]"};d.isUndefined=function(h){return typeof h=="undefined"};d.noConflict=function(){c._=e;return this};d.identity=function(h){return h};d.breakLoop=function(){throw f};var b=0;d.uniqueId=function(h){var j=b++;return h?h+j:j};d.functions=function(){var j=[];for(var h in d){if(Object.prototype.hasOwnProperty.call(d,h)){j.push(h)}}return d.without(j,"VERSION","prototype","noConflict").sort()};d.template=function(k,j){var h=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+k.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return j?h(j):h};d.forEach=d.each;d.foldl=d.inject=d.reduce;d.foldr=d.reduceRight;d.filter=d.select;d.every=d.all;d.some=d.any;d.methods=d.functions;var a=function(j,h){return h?d(j).chain():j};d.each(d.functions(),function(h){g.prototype[h]=function(){Array.prototype.unshift.call(arguments,this._wrapped);return a(d[h].apply(d,arguments),this._chain)}});d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(h){g.prototype[h]=function(){Array.prototype[h].apply(this._wrapped,arguments);return a(this._wrapped,this._chain)}});d.each(["concat","join","slice"],function(h){g.prototype[h]=function(){return a(Array.prototype[h].apply(this._wrapped,arguments),this._chain)}});g.prototype.chain=function(){this._chain=true;return this};g.prototype.value=function(){return this._wrapped}})(); \ No newline at end of file +(function(){var c=this;var e=c._;var g=function(h){this._wrapped=h};var f=typeof StopIteration!=="undefined"?StopIteration:"__break__";var d=c._=function(h){return new g(h)};if(typeof exports!=="undefined"){exports._=d}d.VERSION="0.4.3";d.each=function(q,o,n){var j=0;try{if(q.forEach){q.forEach(o,n)}else{if(q.length){for(var m=0,h=q.length;m=h.computed&&(h={value:o,computed:m})});return h.value};d.min=function(k,j,i){if(!j&&d.isArray(k)){return Math.min.apply(Math,k)}var h={computed:Infinity};d.each(k,function(o,l,n){var m=j?j.call(i,o,l,n):o;mk?1:0}),"value")};d.sortedIndex=function(m,l,j){j=j||d.identity;var h=0,k=m.length;while(h>1;j(m[i])=0})})};d.zip=function(){var h=d.toArray(arguments);var l=d.max(d.pluck(h,"length"));var k=new Array(l);for(var j=0;j=0;j--){arguments=[h[j].apply(this,arguments)]}return arguments[0]}};d.keys=function(h){return d.map(h,function(j,i){return i})};d.values=function(h){return d.map(h,d.identity)};d.extend=function(h,j){for(var i in j){h[i]=j[i]}return h};d.clone=function(h){if(d.isArray(h)){return h.slice(0)}return d.extend({},h)};d.isEqual=function(i,h){if(i===h){return true}var l=typeof(i),n=typeof(h);if(l!=n){return false}if(i==h){return true}if(i.isEqual){return i.isEqual(h)}if(l!=="object"){return false}var j=d.keys(i),m=d.keys(h);if(j.length!=m.length){return false}for(var k in i){if(!d.isEqual(i[k],h[k])){return false}}return true};d.isEmpty=function(h){return(d.isArray(h)?h:d.values(h)).length==0};d.isElement=function(h){return !!(h&&h.nodeType==1)};d.isArray=function(h){return Object.prototype.toString.call(h)=="[object Array]"};d.isFunction=function(h){return Object.prototype.toString.call(h)=="[object Function]"};d.isUndefined=function(h){return typeof h=="undefined"};d.noConflict=function(){c._=e;return this};d.identity=function(h){return h};d.breakLoop=function(){throw f};var b=0;d.uniqueId=function(h){var i=b++;return h?h+i:i};d.functions=function(){var i=[];for(var h in d){if(Object.prototype.hasOwnProperty.call(d,h)){i.push(h)}}return d.without(i,"VERSION","prototype","noConflict").sort()};d.template=function(j,i){var h=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+j.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return i?h(i):h};d.forEach=d.each;d.foldl=d.inject=d.reduce;d.foldr=d.reduceRight;d.filter=d.select;d.every=d.all;d.some=d.any;d.methods=d.functions;var a=function(i,h){return h?d(i).chain():i};d.each(d.functions(),function(h){g.prototype[h]=function(){Array.prototype.unshift.call(arguments,this._wrapped);return a(d[h].apply(d,arguments),this._chain)}});d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(h){g.prototype[h]=function(){Array.prototype[h].apply(this._wrapped,arguments);return a(this._wrapped,this._chain)}});d.each(["concat","join","slice"],function(h){g.prototype[h]=function(){return a(Array.prototype[h].apply(this._wrapped,arguments),this._chain)}});g.prototype.chain=function(){this._chain=true;return this};g.prototype.value=function(){return this._wrapped}})(); \ No newline at end of file diff --git a/underscore.js b/underscore.js index 99e738419..4a85af41f 100644 --- a/underscore.js +++ b/underscore.js @@ -293,7 +293,7 @@ // item in an array, or -1 if the item is not included in the array. _.indexOf = function(array, item) { if (array.indexOf) return array.indexOf(item); - for (i=0, l=array.length; i