#476 fix conditional
This commit is contained in:
parent
bfa1767d81
commit
b8a7d7217d
2 changed files with 7 additions and 2 deletions
|
|
@ -285,7 +285,7 @@ var m = (function app(window, undefined) {
|
|||
configs.push(callback(data, [node, !isNew, context, cached]))
|
||||
}
|
||||
}
|
||||
else if (typeof dataType != FUNCTION) {
|
||||
else if (typeof data != FUNCTION) {
|
||||
//handle text nodes
|
||||
var nodes;
|
||||
if (cached.nodes.length === 0) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function testMithril(mock) {
|
|||
test(function() {return m("div", [1, 2, 3], [4, 5, 6, 7]).children[0].length === 3})
|
||||
test(function() {return m("div", [1, 2, 3], [4, 5, 6, 7]).children[1].length === 4})
|
||||
test(function() {return m("div", [1], [2], [3]).children.length === 3})
|
||||
|
||||
|
||||
//m.module
|
||||
test(function() {
|
||||
mock.requestAnimationFrame.$resolve()
|
||||
|
|
@ -853,6 +853,11 @@ function testMithril(mock) {
|
|||
])
|
||||
return root.childNodes.map(function(node) {return node.id}).join() == "div-1,div-3,div-2"
|
||||
})
|
||||
test(function() {
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("div", function() {}))
|
||||
return root.childNodes[0].childNodes.length == 0
|
||||
})
|
||||
//end m.render
|
||||
|
||||
//m.redraw
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue