Avoid incorrectly converting local variables to boolean values.

Former-commit-id: 322f6dec4c669bdc1ef534f7786cf12aee580e53
This commit is contained in:
John-David Dalton
2013-05-27 15:31:41 -07:00
parent be52c181ea
commit 96e47f3d27
4 changed files with 12 additions and 7 deletions

2
dist/lodash.min.js vendored
View File

@@ -9,7 +9,7 @@ if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if
return a}function V(n){var t,e=[];if(!n||!q[typeof n])return e;for(t in n)ue.call(n,t)&&e.push(t);return e}function G(n){return n&&typeof n=="object"&&!Ce(n)&&ue.call(n,"__wrapped__")?n:new nt(n)}function H(n,t,e){e=(e||0)-1;for(var r=n.length;++e<r;)if(n[e]===t)return e;return-1}function J(n){return n.charCodeAt(0)}function L(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function Q(n,t,e,r){function u(){var r=arguments,c=o?this:t;
return a||(n=t[i]),e.length&&(r=r.length?(r=de.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(c=lt(n.prototype)?le(n.prototype):{},r=n.apply(c,r),lt(r)?r:c):n.apply(c,r)}var a=ct(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Jt;t=n}return u}function W(n){function t(t){return-1<l(n,t)}function e(t){n.push(t)}function o(n){var t=typeof n;if("boolean"==t||n==u)return h[n];var e=h[t]||(t="object",y),r="number"==t?n:p+n;return"object"==t?e[r]?-1<H(e[r],n):a:!!e[r]}function i(n){var t=typeof n;
if("boolean"==t||n==u)h[n]=r;else{var e=h[t]||(t="object",y),a="number"==t?n:p+n;"object"==t?f=(e[a]||(e[a]=[])).push(n)==v:e[a]=r}}n||(n=[]);var f,c=-1,l=Z(),v=n.length,g=v>=s&&G.indexOf!=l,y={},h={"false":a,"function":a,"null":a,number:{},object:y,string:{},"true":a,undefined:a};if(g){for(;++c<v;)i(n[c]);f&&(g=h=y=u)}return g?{contains:o,push:i}:{contains:t,push:e}}function X(n){return Oe[n]}function Y(n){return"\\"+D[n]}function Z(){var n=(n=G.indexOf)==St?H:n;return n}function nt(n){this.__wrapped__=n
}function tt(n){return function(t,r,o,i){return typeof r!="boolean"&&r!=u&&(i=o,o=i&&i[r]===t?e:r,r=a),o!=u&&(o=G.createCallback(o,i)),n(t,r,o,i)}}function et(n){var t,r;return n&&fe.call(n)==B&&(t=n.constructor,!ct(t)||t instanceof t)?(K(n,function(n,t){r=t}),true===e||ue.call(n,r)):a}function rt(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Dt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function ut(n){return Ee[n]}function at(n,t,r,o,i,f){var c=n;if(typeof t!="boolean"&&t!=u&&(o=r,r=t,t=a),typeof r=="function"){if(r=typeof o=="undefined"?r:G.createCallback(r,o,1),c=r(c),typeof c!="undefined")return c;
}function tt(n){return function(t,r,o,i){return typeof r!="boolean"&&r!=u&&(i=o,o=i&&i[r]===t?e:r,r=a),o!=u&&(o=G.createCallback(o,i)),n(t,r,o,i)}}function et(n){var t,r;return n&&fe.call(n)==B&&(t=n.constructor,!ct(t)||t instanceof t)?(K(n,function(n,t){r=t}),r===e||ue.call(n,r)):a}function rt(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Dt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function ut(n){return Ee[n]}function at(n,t,r,o,i,f){var c=n;if(typeof t!="boolean"&&t!=u&&(o=r,r=t,t=a),typeof r=="function"){if(r=typeof o=="undefined"?r:G.createCallback(r,o,1),c=r(c),typeof c!="undefined")return c;
c=n}if(o=lt(c)){var l=fe.call(c);if(!T[l])return c;var p=Ce(c)}if(!o||!t)return o?p?rt(c):U({},c):c;switch(o=je[l],l){case I:case N:return new o(+c);case $:case R:return new o(c);case F:return o(c.source,m.exec(c))}for(i||(i=[]),f||(f=[]),l=i.length;l--;)if(i[l]==n)return f[l];return c=p?o(c.length):{},p&&(ue.call(n,"index")&&(c.index=n.index),ue.call(n,"input")&&(c.input=n.input)),i.push(n),f.push(c),(p?dt:P)(n,function(n,u){c[u]=at(n,t,r,e,i,f)}),c}function ot(n){var t=[];return K(n,function(n,e){ct(n)&&t.push(e)
}),t.sort()}function it(n){for(var t=-1,e=xe(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function ft(n,t,e,o,i,f){var c=e===l;if(typeof e=="function"&&!c){e=G.createCallback(e,o,2);var p=e(n,t);if(typeof p!="undefined")return!!p}if(n===t)return 0!==n||1/n==1/t;var s=typeof n,v=typeof t;if(n===n&&(!n||"function"!=s&&"object"!=s)&&(!t||"function"!=v&&"object"!=v))return a;if(n==u||t==u)return n===t;if(v=fe.call(n),s=fe.call(t),v==E&&(v=B),s==E&&(s=B),v!=s)return a;switch(v){case I:case N:return+n==+t;
case $:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case F:case R:return n==Ht(t)}if(s=v==S,!s){if(ue.call(n,"__wrapped__")||ue.call(t,"__wrapped__"))return ft(n.__wrapped__||n,t.__wrapped__||t,e,o,i,f);if(v!=B)return a;var v=n.constructor,g=t.constructor;if(v!=g&&(!ct(v)||!(v instanceof v&&ct(g)&&g instanceof g)))return a}for(i||(i=[]),f||(f=[]),v=i.length;v--;)if(i[v]==n)return f[v]==t;var y=0,p=r;if(i.push(n),f.push(t),s){if(v=n.length,y=t.length,p=y==n.length,!p&&!c)return p;for(;y--;)if(s=v,g=t[y],c)for(;s--&&!(p=ft(n[s],g,e,o,i,f)););else if(!(p=ft(n[y],g,e,o,i,f)))break;