Replace x instanceof Array with Array.isArray(x)
This commit is contained in:
parent
106a9720d1
commit
d82d337569
10 changed files with 32 additions and 34 deletions
|
|
@ -2,7 +2,7 @@ function Vnode(tag, key, attrs, children, text, dom) {
|
|||
return {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: {}, events: undefined, instance: undefined, skip: false}
|
||||
}
|
||||
Vnode.normalize = function(node) {
|
||||
if (node instanceof Array) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)
|
||||
if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)
|
||||
if (node != null && typeof node !== "object") return Vnode("#", undefined, undefined, node, undefined, undefined)
|
||||
return node
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue