diff --git a/render/hyperscript.js b/render/hyperscript.js index 00c438c9d..768dad8f4 100644 --- a/render/hyperscript.js +++ b/render/hyperscript.js @@ -79,16 +79,11 @@ function execSelector(state, attrs, children) { } function hyperscript(selector) { - // Because sloppy mode sucks - var attrs = arguments[1], start = 2, children - if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") { throw Error("The selector must be either a string or a component."); } - if (typeof selector === "string") { - var cached = selectorCache[selector] || compileSelector(selector) - } + var attrs = arguments[1], start = 2, children if (attrs == null) { attrs = {} @@ -108,7 +103,7 @@ function hyperscript(selector) { var normalized = Vnode.normalizeChildren(children) if (typeof selector === "string") { - return execSelector(cached, attrs, normalized) + return execSelector(selectorCache[selector] || compileSelector(selector), attrs, normalized) } else { return Vnode(selector, attrs.key, attrs, normalized) }