diff --git a/mithril.js b/mithril.js index d98d40d5..30816228 100644 --- a/mithril.js +++ b/mithril.js @@ -202,7 +202,7 @@ Vnode.normalizeChildren = function normalizeChildren(children) { var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g var selectorCache = {} function hyperscript(selector) { - if (selector == null || typeof selector !== "string" && !selector.view) { + if (selector == null || typeof selector !== "string" && selector.view == null) { throw Error("The selector must be either a string or a component."); } if (typeof selector === "string") { @@ -1091,7 +1091,7 @@ var autoredraw = function(root, renderer, pubsub, callback) { m.route = function($window, renderer, pubsub) { var router = coreRouter($window) var route = function(root, defaultRoute, routes) { - var current = {path: null, component: null} + var current = {path: null, component: "div"} var replay = router.defineRoutes(routes, function(payload, args, path, route) { if (typeof payload.view !== "function") { if (typeof payload.render !== "function") payload.render = function(vnode) {return vnode} diff --git a/mithril.min.js b/mithril.min.js index de9b75be..5cfbcd5c 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -6,7 +6,7 @@ b(c)},0)}function g(a){var c=e(),d=this;return A(c,[d],function(){return m(c,a(d !1)};d.map(g)["catch"](function(a){g();throw{__error:a};});if(0===d._state.state)return D;if(d._state.error)throw{__error:d._state.error};c=d._state.value}return c}function A(c,d,g,b){var e=c._state;e.derive=g;e.recover=b;e.parents=d.filter(a);w(c,e.parents);n(c,!0);return c}function w(a,c){for(var d=0;d