From dd3bb62ee75b72210a8de770f9eee86036dfcfbe Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 27 Oct 2016 20:38:03 -0400 Subject: [PATCH] build --- mithril.js | 2 ++ mithril.min.js | 82 +++++++++++++++++++++++++------------------------- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/mithril.js b/mithril.js index a14eacc2..34f77cb8 100644 --- a/mithril.js +++ b/mithril.js @@ -982,6 +982,8 @@ var _18 = function(renderer, pubsub) { delete root.redraw return } + + if (component.view == null) throw new Error("m.mount(element, component) expects a component, not a vnode") var run0 = autoredraw(root, renderer, pubsub, function() { renderer.render(root, Vnode(component, undefined, undefined, undefined, undefined, undefined)) }) diff --git a/mithril.min.js b/mithril.min.js index 3d3dc985..955fc913 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -1,43 +1,43 @@ -new function(){function x(b,f,m,g,k,h){return{tag:b,key:f,attrs:m,children:g,text:k,dom:h,domSize:void 0,state:{},events:void 0,instance:void 0,skip:!1}}function A(b){if(null==b||"string"!==typeof b&&null==b.view)throw Error("The selector must be either a string or a component.");if("string"===typeof b&&void 0===J[b]){for(var f,m,g=[],k={};f=Q.exec(b);){var h=f[1],v=f[2];""===h&&""!==v?m=v:"#"===h?k.id=v:"."===h?g.push(v):"["===f[3][0]&&((h=f[6])&&(h=h.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")), -k[f[4]]=h||!0)}0d.filter(G).length)throw Error("Ensure that each item passed to m.prop.combine/m.prop.merge is a stream"); -return u(f(),d,function(){var e=d.filter(B);if(0e.indexOf("?")?"?":"&";e+=g+f}return e}function k(e){try{return""!==e?JSON.parse(e):null}catch(l){throw Error(e);}}function h(e){return e.responseText}function v(e,b){if("function"===typeof e)if(b instanceof Array)for(var f=0;ft.status||304===t.status)l(v(e.type,b));else{var f=Error(t.responseText),g;for(g in b)f[g]=b[g];l.error(f)}}catch(D){l.error(D)}"function"===typeof n&&n()}};y?t.send(e.data):t.send();return l},jsonp:function(e){var l=f();void 0!==e.initialValue&&l(e.initialValue);var h=e.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+w++,k=b.document.createElement("script");b[h]=function(f){k.parentNode.removeChild(k);l(v(e.type,f));"function"===typeof n&&n();delete b[h]};k.onerror=function(){k.parentNode.removeChild(k); -l.error(Error("JSONP request failed"));"function"===typeof n&&n();delete b[h]};null==e.data&&(e.data={});e.url=m(e.url,e.data);e.data[e.callbackKey||"callback"]=h;k.src=g(e.url,e.data);b.document.documentElement.appendChild(k);return l},setCompletionCallback:function(b){n=b}}}(window,O),M=function(){var b=[];return{subscribe:b.push.bind(b),unsubscribe:function(f){f=b.indexOf(f);-1d.filter(G).length)throw Error("Ensure that each item passed to m.prop.combine/m.prop.merge is a stream"); +return v(f(),d,function(){var e=d.filter(B);if(0e.indexOf("?")?"?":"&";e+=g+f}return e}function k(e){try{return""!==e?JSON.parse(e):null}catch(l){throw Error(e);}}function h(e){return e.responseText}function w(e,b){if("function"===typeof e)if(b instanceof Array)for(var f=0;fu.status||304===u.status)l(w(e.type,b));else{var f=Error(u.responseText),g;for(g in b)f[g]=b[g];l.error(f)}}catch(D){l.error(D)}"function"===typeof m&&m()}};r?u.send(e.data):u.send();return l},jsonp:function(e){var h=f();void 0!==e.initialValue&&h(e.initialValue);var r=e.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+x++,k=b.document.createElement("script");b[r]=function(f){k.parentNode.removeChild(k);h(w(e.type,f));"function"===typeof m&&m();delete b[r]};k.onerror=function(){k.parentNode.removeChild(k); +h.error(Error("JSONP request failed"));"function"===typeof m&&m();delete b[r]};null==e.data&&(e.data={});e.url=p(e.url,e.data);e.data[e.callbackKey||"callback"]=r;k.src=g(e.url,e.data);b.document.documentElement.appendChild(k);return h},setCompletionCallback:function(b){m=b}}}(window,O),M=function(){var b=[];return{subscribe:b.push.bind(b),unsubscribe:function(f){f=b.indexOf(f);-1=p&&y>=B;){var r=a[p],u=d[B];if(r!==u||q)if(null!=r&&null!=u&&r.key===u.key)p++,B++,h(c,r,u,b,w(a,p,g),q,l),q&&r.tag===u.tag&&n(c,v(r),g);else if(r=a[k],r!==u||q)if(null!=r&&null!=u&&r.key===u.key)h(c,r,u,b,w(a,k+1,g),q,l),(q||B=p&&y>=B;){r=a[k];u=d[y];if(r!==u||q)if(null!=r&&null!=u&&r.key===u.key)h(c,r,u,b,w(a,k+1,g),q,l),q&&r.tag===u.tag&&n(c,v(r),g),null!=r.dom&&(g=r.dom),k--;else{if(!t){t=a;var r=k,C={},E;for(E= -0;E=n&&k>=B;){var t=a[n],v=d[B];if(t!==v||q)if(null!=t&&null!=v&&t.key===v.key)n++,B++,h(c,t,v,b,x(a,n,g),q,l),q&&t.tag===v.tag&&m(c,w(t),g);else if(t=a[r],t!==v||q)if(null!=t&&null!=v&&t.key===v.key)h(c,t,v,b,x(a,r+1,g),q,l),(q||B=n&&k>=B;){t=a[r];v=d[k];if(t!==v||q)if(null!=t&&null!=v&&t.key===v.key)h(c,t,v,b,x(a,r+1,g),q,l),q&&t.tag===v.tag&&m(c,w(t),g),null!=t.dom&&(g=t.dom),r--;else{if(!u){u=a;var t=r,C={},E;for(E= +0;E