(selector)
| 80 | return Vnode(state.tag, attrs.key, hasAttrs ? attrs : null, childList, text) |
| 81 | } |
| 82 | function hyperscript(selector) { |
| 83 | if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") { |
| 84 | throw Error("The selector must be either a string or a component."); |
| 85 | } |
| 86 | var attrs = arguments[1], start = 2, children |
| 87 | if (attrs == null) { |
| 88 | attrs = {} |
| 89 | } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) { |
| 90 | attrs = {} |
| 91 | start = 1 |
| 92 | } |
| 93 | if (arguments.length === start + 1) { |
| 94 | children = arguments[start] |
| 95 | if (!Array.isArray(children)) children = [children] |
| 96 | } else { |
| 97 | children = [] |
| 98 | while (start < arguments.length) children.push(arguments[start++]) |
| 99 | } |
| 100 | if (typeof selector === "string") { |
| 101 | return execSelector(selectorCache[selector] || compileSelector(selector), attrs, Vnode.normalizeChildren(children)) |
| 102 | } else { |
| 103 | return Vnode(selector, attrs.key, attrs, children) |
| 104 | } |
| 105 | } |
| 106 | hyperscript.trust = function(html) { |
| 107 | if (html == null) html = "" |
| 108 | return Vnode("<", undefined, undefined, html, undefined, undefined) |
nothing calls this directly
no test coverage detected