Merge pull request #189 from oleg8sh/patch-1

undefined cached checks.
This commit is contained in:
Leo Horie 2014-08-08 18:02:32 -04:00
commit c2aa89ec55

View file

@ -33,7 +33,7 @@ Mithril = m = new function app(window, undefined) {
if (data.subtree === "retain") return cached
var cachedType = type.call(cached), dataType = type.call(data)
if (cachedType != dataType) {
if (cached === undefined || cached === null || cachedType != dataType) {
if (cached !== null && cached !== undefined) {
if (parentCache && parentCache.nodes) {
var offset = index - parentIndex