Merge two if blocks, chomp an indentation level

This commit is contained in:
Pierre-Yves Gerardy 2016-08-02 23:27:26 +02:00
parent 905309cb17
commit 71c20b84b8

View file

@ -9,8 +9,7 @@ function hyperscript(selector) {
throw Error("The selector must be either a string or a component."); throw Error("The selector must be either a string or a component.");
} }
if (typeof selector === "string") { if (typeof selector === "string" && selectorCache[selector] === undefined) {
if (selectorCache[selector] === undefined) {
var match, tag, classes = [], attributes = {} var match, tag, classes = [], attributes = {}
while (match = selectorParser.exec(selector)) { while (match = selectorParser.exec(selector)) {
var type = match[1], value = match[2] var type = match[1], value = match[2]
@ -47,7 +46,6 @@ function hyperscript(selector) {
return Vnode(tag || "div", attrs.key, hasAttrs ? attrs : undefined, childList, text, undefined) return Vnode(tag || "div", attrs.key, hasAttrs ? attrs : undefined, childList, text, undefined)
} }
} }
}
var attrs, children, childrenIndex var attrs, children, childrenIndex
if (arguments[1] == null || typeof arguments[1] === "object" && arguments[1].tag === undefined && !(arguments[1] instanceof Array)) { if (arguments[1] == null || typeof arguments[1] === "object" && arguments[1].tag === undefined && !(arguments[1] instanceof Array)) {
attrs = arguments[1] attrs = arguments[1]