Commits

Stephen McKamey committed fead66b

- Buffer fixes

Comments (0)

Files changed (5)

 
 	/**
 	 * @private
+	 * @constant
 	 * @type {boolean}
 	 */
-	Buffer.FAST = (window.navigator.userAgent.indexOf('MSIE') < 0);
+	Buffer.FAST = (window.navigator.userAgent.indexOf("MSIE") < 0);
 
 	/**
 	 * Appends to the internal value
 		if (Buffer.FAST) {
 			this.value += v1;
 
-			if (typeof v2 !== "undefined") {
+			/*jslint eqeqeq: false */
+			if (v2 != null) {
 				this.value += v2;
 
-				if (typeof v3 !== "undefined") {
+				if (v3 != null) {
 					this.value += v3;
 				}
 			}
+			/*jslint eqeqeq: true */
 		} else {
-			this.value.push(v1);
-
-			if (typeof v2 !== "undefined") {
-				this.value.push(v2);
-
-				if (typeof v3 !== "undefined") {
-					this.value.push(v3);
-				}
-			}
+			this.value.push.apply(
+				// Closure Compiler type cast
+				/** @type{Array} */(this.value),
+				arguments);
 		}
 	};
 
 c;if(c==="style")if(typeof e.style.cssText!=="undefined")e.style.cssText=h;else e.style=h;else if(c==="class")e.className=h;else if(L[c]){z(e,c,h);o[c]&&z(e,o[c],h)}else if(i(h)===4){e.setAttribute(c,h);o[c]&&e.setAttribute(o[c],h)}else{e[c]=h;if(o[c])e[o[c]]=h}}}a=e}break;case 5:e=t;f=a;h=c;c=n("div");c.innerHTML=""+h;B(c);if(c.childNodes.length===1)c=c.firstChild;else{for(h=n("");c.firstChild;)h.appendChild(c.firstChild);c=h}e(f,c)}}B(a);J(a);if(a.nodeType===11&&a.childNodes.length===1)a=a.firstChild;
 return a}var l=u.document;v.prototype.toString=function(){return this.value};var j;j=function(a,b,d,c){var e;switch(i(a)){case 1:e=a(b,d,c);break;case 2:var f=a[0]||"";switch(f){case "$for":a=a;f=a[1]&&a[1].each;if(i(f)===1)f=f(b,d,c);a=a.length===3?a[2]:[""].concat(a.slice(2));b=[""];switch(i(f)){case 2:d=0;for(c=f.length;d<c;d++)s(b,j(a,f[d],d,c));break;case 3:for(e in f)f.hasOwnProperty(e)&&s(b,j(a,f[e],e,0))}e=b;break;case "$choose":e=w(a,b,d,c);break;case "$if":case "$else":e=w(["$choose",a],
 b,d,c);break;case "$call":var g=a[1];if(!g||!g.view)e=null;else{a=j(g.view,b,d,c);e=j(g.model,b,d,c);f=j(g.index,b,d,c);b=j(g.count,b,d,c);e=j(p(a).value,e,f,b)}break;default:e=[f];f=1;for(g=a.length;f<g;f++)s(e,j(a[f],b,d,c))}break;case 3:e={};for(f in a)if(a.hasOwnProperty(f))e[f]=j(a[f],b,d,c);break;default:e=a}return e};q.prototype.bind=q.prototype.bind=function(a){a=j(this.value,a,0,1);return new r(a)};var I={area:true,base:true,basefont:true,br:true,col:true,frame:true,hr:true,img:true,input:true,
-isindex:true,keygen:true,link:true,meta:true,param:true,source:true,wbr:true};k.FAST=u.navigator.userAgent.indexOf("MSIE")<0;k.prototype.append=function(a,b,d){if(k.FAST){this.value+=a;if(typeof b!=="undefined"){this.value+=b;if(typeof d!=="undefined")this.value+=d}}else{this.value.push(a);if(typeof b!=="undefined"){this.value.push(b);typeof d!=="undefined"&&this.value.push(d)}}};k.prototype.clear=function(){this.value=k.FAST?"":[]};k.prototype.toString=function(){return k.FAST?this.value:this.value.join("")};
-r.prototype.toString=function(){return y(this.value)};q.prototype.toString=function(){return y(this.value)};var K={rowspan:"rowSpan",colspan:"colSpan",cellpadding:"cellPadding",cellspacing:"cellSpacing",tabindex:"tabIndex",accesskey:"accessKey",hidefocus:"hideFocus",usemap:"useMap",maxlength:"maxLength",readonly:"readOnly",contenteditable:"contentEditable"},o={enctype:"encoding",onscroll:"DOMMouseScroll"},L={onblur:true,onchange:true,onclick:true,ondblclick:true,onerror:true,onfocus:true,onkeydown:true,
-onkeypress:true,onkeyup:true,onload:true,onmousedown:true,onmouseenter:true,onmouseleave:true,onmousemove:true,onmouseout:true,onmouseover:true,onmouseup:true,onresize:true,onscroll:true,onselect:true,onsubmit:true,onunload:true};r.prototype.toDOM=r.prototype.toDOM=function(){try{return E(n(this.value[0]),this.value)}catch(a){try{return(typeof p.onerror==="function"?p.onerror:D)(a,this.value)}catch(b){return D(b)}}};var p=u.duel=function(a){return a instanceof q?a:new q(a)};p.raw=p.raw=function(a){return new v(a)};
-return p}(window);
+isindex:true,keygen:true,link:true,meta:true,param:true,source:true,wbr:true};k.FAST=u.navigator.userAgent.indexOf("MSIE")<0;k.prototype.append=function(a,b,d){if(k.FAST){this.value+=a;if(b!=null){this.value+=b;if(d!=null)this.value+=d}}else this.value.push.apply(this.value,arguments)};k.prototype.clear=function(){this.value=k.FAST?"":[]};k.prototype.toString=function(){return k.FAST?this.value:this.value.join("")};r.prototype.toString=function(){return y(this.value)};q.prototype.toString=function(){return y(this.value)};
+var K={rowspan:"rowSpan",colspan:"colSpan",cellpadding:"cellPadding",cellspacing:"cellSpacing",tabindex:"tabIndex",accesskey:"accessKey",hidefocus:"hideFocus",usemap:"useMap",maxlength:"maxLength",readonly:"readOnly",contenteditable:"contentEditable"},o={enctype:"encoding",onscroll:"DOMMouseScroll"},L={onblur:true,onchange:true,onclick:true,ondblclick:true,onerror:true,onfocus:true,onkeydown:true,onkeypress:true,onkeyup:true,onload:true,onmousedown:true,onmouseenter:true,onmouseleave:true,onmousemove:true,
+onmouseout:true,onmouseover:true,onmouseup:true,onresize:true,onscroll:true,onselect:true,onsubmit:true,onunload:true};r.prototype.toDOM=r.prototype.toDOM=function(){try{return E(n(this.value[0]),this.value)}catch(a){try{return(typeof p.onerror==="function"?p.onerror:D)(a,this.value)}catch(b){return D(b)}}};var p=u.duel=function(a){return a instanceof q?a:new q(a)};p.raw=p.raw=function(a){return new v(a)};return p}(window);
 	var duel = window[DUEL_EXTERN] = function(view) {
 		return (view instanceof View) ? view : new View(view);
 	};
-	
+
 	/**
 	 * @public
 	 * @param {string} value Markup text
 
 	/**
 	 * @private
+	 * @constant
 	 * @type {boolean}
 	 */
-	Buffer.FAST = (window.navigator.userAgent.indexOf('MSIE') < 0);
+	Buffer.FAST = (window.navigator.userAgent.indexOf("MSIE") < 0);
 
 	/**
 	 * Appends to the internal value
 		if (Buffer.FAST) {
 			this.value += v1;
 
-			if (typeof v2 !== "undefined") {
+			/*jslint eqeqeq: false */
+			if (v2 != null) {
 				this.value += v2;
 
-				if (typeof v3 !== "undefined") {
+				if (v3 != null) {
 					this.value += v3;
 				}
 			}
+			/*jslint eqeqeq: true */
 		} else {
-			this.value.push(v1);
-
-			if (typeof v2 !== "undefined") {
-				this.value.push(v2);
-
-				if (typeof v3 !== "undefined") {
-					this.value.push(v3);
-				}
-			}
+			this.value.push.apply(
+				// Closure Compiler type cast
+				/** @type{Array} */(this.value),
+				arguments);
 		}
 	};
 
 JSLINT(src, { browser: true, undef: true, eqeqeq: true, regexp: true, newcap: true, maxerr: 100 });
 
 var ok = {
-	// "Expected an identifier and instead saw 'undefined' (a reserved word).": true
+	"Use '===' to compare with 'null'.": true,
+	"Use '!==' to compare with 'null'.": true
 };
 
 var e = JSLINT.errors, found = 0, w;