#476 fix conditional

This commit is contained in:
Leo Horie 2015-03-09 21:30:15 -04:00
parent bfa1767d81
commit b8a7d7217d
2 changed files with 7 additions and 2 deletions

View file

@ -285,7 +285,7 @@ var m = (function app(window, undefined) {
configs.push(callback(data, [node, !isNew, context, cached])) configs.push(callback(data, [node, !isNew, context, cached]))
} }
} }
else if (typeof dataType != FUNCTION) { else if (typeof data != FUNCTION) {
//handle text nodes //handle text nodes
var nodes; var nodes;
if (cached.nodes.length === 0) { if (cached.nodes.length === 0) {

View file

@ -853,6 +853,11 @@ function testMithril(mock) {
]) ])
return root.childNodes.map(function(node) {return node.id}).join() == "div-1,div-3,div-2" 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 //end m.render
//m.redraw //m.redraw