From dc379a4cf8bd51c93bbaee98b182bd967949e4e2 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Sat, 3 May 2014 08:20:30 -0400 Subject: [PATCH] added test to prevent releases w/ console.log --- archive/v0.1.11/mithril-tests.js | 7 +++++++ archive/v0.1.11/mithril.js | 2 ++ archive/v0.1.11/mithril.min.js | 2 +- archive/v0.1.11/mithril.min.map | 2 +- archive/v0.1.11/mithril.min.zip | Bin 42032 -> 41934 bytes mithril.js | 2 ++ tests/mithril-tests.js | 5 +++++ 7 files changed, 18 insertions(+), 2 deletions(-) diff --git a/archive/v0.1.11/mithril-tests.js b/archive/v0.1.11/mithril-tests.js index b07ec473..9a65e1e0 100644 --- a/archive/v0.1.11/mithril-tests.js +++ b/archive/v0.1.11/mithril-tests.js @@ -474,6 +474,8 @@ Mithril = m = new function app(window) { //testing API m.deps = function(mock) {return window = mock} + //for internal testing only, do not use `m.deps.factory` + m.deps.factory = app return m }(this) @@ -1221,6 +1223,11 @@ function testMithril(mock) { m.endComputation() return root.childNodes[0].nodeValue === "foo" }) + + //console.log presence + test(function() { + return m.deps.factory.toString().indexOf("console") < 0 + }) } //mocks diff --git a/archive/v0.1.11/mithril.js b/archive/v0.1.11/mithril.js index f5d675e1..e4894d11 100644 --- a/archive/v0.1.11/mithril.js +++ b/archive/v0.1.11/mithril.js @@ -474,6 +474,8 @@ Mithril = m = new function app(window) { //testing API m.deps = function(mock) {return window = mock} + //for internal testing only, do not use `m.deps.factory` + m.deps.factory = app return m }(this) diff --git a/archive/v0.1.11/mithril.min.js b/archive/v0.1.11/mithril.min.js index e949e59a..61ec38d9 100644 --- a/archive/v0.1.11/mithril.min.js +++ b/archive/v0.1.11/mithril.min.js @@ -4,5 +4,5 @@ http://github.com/lhorie/mithril.js (c) Leo Horie License: MIT */ -Mithril=m=new function(a){function b(){var a=arguments,b="[object Object]"==u.call(a[1]),c=b?a[1]:{},d="class"in c?"class":"className",e=t[a[0]];if(void 0===e){t[a[0]]=e={tag:"div",attrs:{}};for(var f,h=[];f=v.exec(a[0]);)if(""==f[1])e.tag=f[2];else if("#"==f[1])e.attrs.id=f[2];else if("."==f[1])h.push(f[2]);else if("["==f[3][0]){var i=w.exec(f[3]);e.attrs[i[1]]=i[3]||!0}h.length>0&&(e.attrs[d]=h.join(" "))}e=g(e),e.attrs=g(e.attrs),e.children=b?a[2]:a[1];for(var j in c)e.attrs[j]=j==d?(e.attrs[j]||"")+" "+c[j]:c[j];return e}function c(b,g,h,i,j,k,l,m){if((null===h||void 0===h)&&(h=""),"retain"!==h.subtree){var n=u.call(i),o=u.call(h);if(n!=o&&(null!==i&&void 0!==i&&e(i.nodes),i=new h.constructor,i.nodes=[]),"[object Array]"==o){for(var p=[],q=i.length===h.length,r=0,s=0,t=0;s-1?new h.constructor(h):h,i.nodes=[w];else if(i.valueOf()!==h.valueOf()||j===!0){if(!l||l!==a.document.activeElement)if(h.$trusted){var y=i.nodes[0],p=[y];if(y){for(;y=y.nextSibling;)p.push(y);e(p),w=f(b,k,h)}else b.innerHTML=h}else w=i.nodes[0],"textarea"===g?b.value=h:l?l.innerHTML=h:(b.insertBefore(w,b.childNodes[k]||null),w.nodeValue=h);i=new h.constructor(h),i.nodes=[w]}else i.nodes.intact=!0}return i}}function d(b,c,d,e,f){for(var g in d){var i=d[g],j=e[g];if(!(g in e)||j!==i||b===a.document.activeElement){if(e[g]=i,"config"===g)continue;if("function"==typeof i&&0==g.indexOf("on"))b[g]=h(i,b);else if("style"===g)for(var k in i)(void 0===j||j[k]!==i[k])&&(b.style[k]=i[k]);else void 0!==f?"href"===g?b.setAttributeNS("http://www.w3.org/1999/xlink","href",i):"className"===g?b.setAttribute("class",i):b.setAttribute(g,i):"value"===g&&"input"===c?b.value!==i&&(b.value=i):g in b?b[g]=i:b.setAttribute(g,i)}}return e}function e(a){for(var b=a.length-1;b>-1;b--)a[b].parentNode.removeChild(a[b]);a.length=0}function f(a,b,c){var d=a.childNodes[b];return d?d.insertAdjacentHTML("beforebegin",c):a.insertAdjacentHTML("beforeend",c),d?d.previousSibling:a.firstChild}function g(a){var b={};for(var c in a)b[c]=a[c];return b}function h(a,c){return function(d){b.startComputation();var e=a.call(c,d);return b.endComputation(),e}}function i(){for(var a=0;a0&&("GET"==a.method?a.url=a.url+(a.url.indexOf("?")<0?"?":"&")+o(b):a.data=c(b)),a}function q(a,b){var c=a.match(/:[a-z]\w+/gi);if(c&&b)for(var d=0;de?y.push(b)-1:e,g=b==a.document||b==a.document.documentElement?x:b;z[f]=c(g,null,d,z[f],!1,0,null,void 0)},b.trust=function(a){return a=new String(a),a.$trusted=!0,a};var A=[],B=[],C=[],D=0,E=0,F=0,G=null;b.module=function(a,c){b.startComputation();var d=A.indexOf(a);0>d&&(d=A.length),A[d]=a,B[d]=c,C[d]=new c.controller,b.endComputation()},b.redraw=function(){if(D=a.performance&&a.performance.now?a.performance.now():(new a.Date).getTime(),D-E>16)i();else{var b=a.cancelAnimationFrame||a.clearTimeout,c=a.requestAnimationFrame||a.setTimeout;b(F),F=c(i,0)}};var H=0;b.startComputation=function(){H++},b.endComputation=function(){H=Math.max(H-1,0),0==H&&b.redraw()},b.withAttr=function(a,b){return function(c){b(a in c.currentTarget?c.currentTarget[a]:c.currentTarget.getAttribute(a))}};var I,J={pathname:"",hash:"#",search:"?"},K=function(){},L={};return b.route=function(){if(0===arguments.length)return I;if(3===arguments.length){I=a.location[b.route.mode].slice(J[b.route.mode].length);var c=arguments[0],d=arguments[1],e=arguments[2];K=function(a){var f=a.slice(J[b.route.mode].length);j(c,e,f)||b.route(d,!0)};var f="hash"==b.route.mode?"onhashchange":"onpopstate";a[f]=function(){K(a.location[b.route.mode])},G=l,a[f]()}else if(arguments[0].addEventListener){var g=arguments[0],h=arguments[1];g.href=J[b.route.mode]+g.pathname,h||(g.removeEventListener("click",k),g.addEventListener("click",k))}else if("string"==typeof arguments[0]){I=arguments[0];var i=arguments[1]===!0;a.history.pushState?(G=function(){a.history[i?"replaceState":"pushState"](null,a.document.title,J[b.route.mode]+I),l()},K(J[b.route.mode]+I)):a.location[b.route.mode]=I}},b.route.param=function(a){return L[a]},b.route.mode="search",b.prop=function(a){var b=function(){return arguments.length&&(a=arguments[0]),a};return b.toJSON=function(){return a},b},b.deferred=function(){var a=[],c=[],d={resolve:function(b){for(var c=0;c0&&(e.attrs[d]=g.join(" "))}e=h(e),e.attrs=h(e.attrs),e.children=b?a[2]:a[1];for(var j in c)e.attrs[j]=j==d?(e.attrs[j]||"")+" "+c[j]:c[j];return e}function d(a,c,h,i,j,k,l,m){if((null===h||void 0===h)&&(h=""),"retain"!==h.subtree){var n=v.call(i),o=v.call(h);if(n!=o&&(null!==i&&void 0!==i&&f(i.nodes),i=new h.constructor,i.nodes=[]),"[object Array]"==o){for(var p=[],q=i.length===h.length,r=0,s=0,t=0;s-1?new h.constructor(h):h,i.nodes=[w];else if(i.valueOf()!==h.valueOf()||j===!0){if(!l||l!==b.document.activeElement)if(h.$trusted){var y=i.nodes[0],p=[y];if(y){for(;y=y.nextSibling;)p.push(y);f(p),w=g(a,k,h)}else a.innerHTML=h}else w=i.nodes[0],"textarea"===c?a.value=h:l?l.innerHTML=h:(a.insertBefore(w,a.childNodes[k]||null),w.nodeValue=h);i=new h.constructor(h),i.nodes=[w]}else i.nodes.intact=!0}return i}}function e(a,c,d,e,f){for(var g in d){var h=d[g],j=e[g];if(!(g in e)||j!==h||a===b.document.activeElement){if(e[g]=h,"config"===g)continue;if("function"==typeof h&&0==g.indexOf("on"))a[g]=i(h,a);else if("style"===g)for(var k in h)(void 0===j||j[k]!==h[k])&&(a.style[k]=h[k]);else void 0!==f?"href"===g?a.setAttributeNS("http://www.w3.org/1999/xlink","href",h):"className"===g?a.setAttribute("class",h):a.setAttribute(g,h):"value"===g&&"input"===c?a.value!==h&&(a.value=h):g in a?a[g]=h:a.setAttribute(g,h)}}return e}function f(a){for(var b=a.length-1;b>-1;b--)a[b].parentNode.removeChild(a[b]);a.length=0}function g(a,b,c){var d=a.childNodes[b];return d?d.insertAdjacentHTML("beforebegin",c):a.insertAdjacentHTML("beforeend",c),d?d.previousSibling:a.firstChild}function h(a){var b={};for(var c in a)b[c]=a[c];return b}function i(a,b){return function(d){c.startComputation();var e=a.call(b,d);return c.endComputation(),e}}function j(){for(var a=0;a0&&("GET"==a.method?a.url=a.url+(a.url.indexOf("?")<0?"?":"&")+p(b):a.data=c(b)),a}function r(a,b){var c=a.match(/:[a-z]\w+/gi);if(c&&b)for(var d=0;de?z.push(a)-1:e,g=a==b.document||a==b.document.documentElement?y:a;A[f]=d(g,null,c,A[f],!1,0,null,void 0)},c.trust=function(a){return a=new String(a),a.$trusted=!0,a};var B=[],C=[],D=[],E=0,F=0,G=0,H=null;c.module=function(a,b){c.startComputation();var d=B.indexOf(a);0>d&&(d=B.length),B[d]=a,C[d]=b,D[d]=new b.controller,c.endComputation()},c.redraw=function(){if(E=b.performance&&b.performance.now?b.performance.now():(new b.Date).getTime(),E-F>16)j();else{var a=b.cancelAnimationFrame||b.clearTimeout,c=b.requestAnimationFrame||b.setTimeout;a(G),G=c(j,0)}};var I=0;c.startComputation=function(){I++},c.endComputation=function(){I=Math.max(I-1,0),0==I&&c.redraw()},c.withAttr=function(a,b){return function(c){b(a in c.currentTarget?c.currentTarget[a]:c.currentTarget.getAttribute(a))}};var J,K={pathname:"",hash:"#",search:"?"},L=function(){},M={};return c.route=function(){if(0===arguments.length)return J;if(3===arguments.length){J=b.location[c.route.mode].slice(K[c.route.mode].length);var a=arguments[0],d=arguments[1],e=arguments[2];L=function(b){var f=b.slice(K[c.route.mode].length);k(a,e,f)||c.route(d,!0)};var f="hash"==c.route.mode?"onhashchange":"onpopstate";b[f]=function(){L(b.location[c.route.mode])},H=m,b[f]()}else if(arguments[0].addEventListener){var g=arguments[0],h=arguments[1];g.href=K[c.route.mode]+g.pathname,h||(g.removeEventListener("click",l),g.addEventListener("click",l))}else if("string"==typeof arguments[0]){J=arguments[0];var i=arguments[1]===!0;b.history.pushState?(H=function(){b.history[i?"replaceState":"pushState"](null,b.document.title,K[c.route.mode]+J),m()},L(K[c.route.mode]+J)):b.location[c.route.mode]=J}},c.route.param=function(a){return M[a]},c.route.mode="search",c.prop=function(a){var b=function(){return arguments.length&&(a=arguments[0]),a};return b.toJSON=function(){return a},b},c.deferred=function(){var a=[],b=[],d={resolve:function(b){for(var c=0;caXSP8`2tXT5funfiLzb&Q?tGFfIHeq{Yf><~znMckda`*3D= z*0Zy_PQ0r?p{PPoNN-hsP>Ghbv=vkWRu!#^D5YxYk1C?5RVDhMj~}RiP=8fIt*V|o zv%B8VRH`N4opbKF=Y76A^V%<3Z@$;scQ(?tr?Z9q6$3Xy-;4eI8!wHuw7hh^@6kJ* zn2!rPi9%K}(|XpaT>lo&6|djCx4#g@QFkonODFiEo>rZ1Ns@@LQ=l%6cO<1~%$JZ# zbe(&UOVU?3p4+Cs=Em+xiWY8i&z&R=Rq21BYO)HoS?6^ z9S;@2RKeaC(^(TMX1UC7NuwSC8Iw}Mna<`-oK=XPaLR^(ulNf!C%qn&j+&E`F{wcN z_WY5<^dEbE#wF-mdmrcG^uG3^us+g0%Mto~yOUGt5879IFqp^_!wiswZV1HCB$-A3{Aju*j$xqa&4 z1fLU7Nva>L5G_xfn7+ObwJCl~|Fm!Lb{4xjjWz;FdaQGVOVO`)9(AP3WejzU)Au?@ zf%Uh}DQ9Y80!o{NuvD_Wmf&4_7HWi}$(WSpQxM+l{;^0(*lmK%a(Od)IW{UuDfkf} z`B==GS2O~Y&GK39*8{PUO`A&cV;E3LgmD~mR1Pw z5n@sTNMEy9l*EJzB%_f7jlO(`ms9AU@966Tr*+6S(@N@EB2k52A3U@KgWEWhf!JLs zoKLw%rRFme6LC?~70j?iWcv{1XE@M&+MNT}vOE@cYWc*wigm_j8C9gX_+UuS;B6RT!~?p`lSXJhT^Jh@rVV?>gRz zMLnzOScTs7-8H?Rk;E``1L*C$o;d*xpl1{5w1q>2ZY%+2;h#WoH zbAijzXL~ldE&A7qtze|ydv zlhEuejFdI(*HkIco_P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