Support classes and factories as components (#1339)
* Support classes and factories as components * Tests for class and factory component support
This commit is contained in:
parent
ff16c7f47a
commit
3f3af74dde
5 changed files with 301 additions and 16 deletions
|
|
@ -5,7 +5,7 @@ var Vnode = require("../render/vnode")
|
|||
var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
|
||||
var selectorCache = {}
|
||||
function hyperscript(selector) {
|
||||
if (selector == null || typeof selector !== "string" && typeof selector.view !== "function") {
|
||||
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.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue