Merge two if blocks, chomp an indentation level
This commit is contained in:
parent
905309cb17
commit
71c20b84b8
1 changed files with 32 additions and 34 deletions
|
|
@ -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]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue