Check for weird edge-case & tests
This commit is contained in:
parent
c3d3fa7315
commit
f3018776b8
2 changed files with 13 additions and 1 deletions
|
|
@ -194,7 +194,7 @@ Mithril = m = new function app(window, undefined) {
|
|||
clear(cached.nodes)
|
||||
if (cached.configContext && isFn(cached.configContext.onunload)) cached.configContext.onunload()
|
||||
}
|
||||
if (typeof data.tag != "string") return
|
||||
if (!isStr(data.tag)) return
|
||||
|
||||
var node, isNew = cached.nodes.length === 0
|
||||
if (data.attrs.xmlns) namespace = data.attrs.xmlns
|
||||
|
|
|
|||
|
|
@ -154,6 +154,18 @@ function testMithril(mock) {
|
|||
m.render(root, m("ul", [{}]))
|
||||
return root.childNodes[0].childNodes.length === 0
|
||||
})
|
||||
test(function() {
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("ul", [m("li")]))
|
||||
m.render(root, m("ul", [{tag: "b", attrs: {}}]))
|
||||
return root.childNodes[0].childNodes[0].nodeName == "B"
|
||||
})
|
||||
test(function() {
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("ul", [m("li")]))
|
||||
m.render(root, m("ul", [{tag: new String("b"), attrs: {}}]))
|
||||
return root.childNodes[0].childNodes[0].nodeName == "B"
|
||||
})
|
||||
test(function() {
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("ul", [m("li", [m("a")])]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue