diff --git a/mithril.js b/mithril.js index c3cf4c53..bc3045c8 100644 --- a/mithril.js +++ b/mithril.js @@ -73,7 +73,7 @@ function hyperscript(selector) { if (typeof selector === "string") { var cached = selectorCache[selector] || compileSelector(selector) } - if (!attrs) { + if (attrs == null) { attrs = {} } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) { attrs = {} diff --git a/mithril.min.js b/mithril.min.js index a7ddf4e9..58d33dde 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -1,5 +1,5 @@ (function(){function B(b,d,f,g,e,n){return{tag:b,key:d,attrs:f,children:g,text:e,dom:n,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}function C(b){var d=arguments[1],f=2,g;if(null==b||"string"!==typeof b&&"function"!==typeof b&&"function"!==typeof b.view)throw Error("The selector must be either a string or a component.");if("string"===typeof b){var e;if(!(e=M[b])){g="div";for(var n=[],k={};e=P.exec(b);){var q=e[1],m=e[2];""===q&&""!==m?g=m:"#"===q?k.id=m:"."===q? -n.push(m):"["===e[3][0]&&((q=e[6])&&(q=q.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?n.push(q):k[e[4]]=q||!0)}0