* Handle `[` fragment selector. Fix #2349 * Update tests * Simplify hyperscript function
This commit is contained in:
parent
1aaa2ff568
commit
39c20bdb34
2 changed files with 186 additions and 173 deletions
|
|
@ -90,11 +90,12 @@ function hyperscript(selector) {
|
|||
var vnode = hyperscriptVnode.apply(1, arguments)
|
||||
|
||||
if (typeof selector === "string") {
|
||||
return execSelector(selectorCache[selector] || compileSelector(selector), vnode)
|
||||
} else {
|
||||
vnode.tag = selector
|
||||
return vnode
|
||||
vnode.children = Vnode.normalizeChildren(vnode.children)
|
||||
if (selector !== "[") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)
|
||||
}
|
||||
|
||||
vnode.tag = selector
|
||||
return vnode
|
||||
}
|
||||
|
||||
module.exports = hyperscript
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue