From e08c626abfe522f809d616ef03bbacec558fa9e1 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Sun, 10 Aug 2014 21:36:52 -0400 Subject: [PATCH] fix IE8 null ref --- mithril.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mithril.js b/mithril.js index 06c5d5b0..290d0232 100644 --- a/mithril.js +++ b/mithril.js @@ -4,7 +4,7 @@ Mithril = m = new function app(window, undefined) { function m() { var args = arguments - var hasAttrs = type.call(args[1]) == "[object Object]" && !("tag" in args[1]) && !("subtree" in args[1]) + var hasAttrs = args[1] !== undefined && type.call(args[1]) == "[object Object]" && !("tag" in args[1]) && !("subtree" in args[1]) var attrs = hasAttrs ? args[1] : {} var classAttrName = "class" in attrs ? "class" : "className" var cell = {tag: "div", attrs: {}} @@ -29,8 +29,7 @@ Mithril = m = new function app(window, undefined) { return cell } function build(parentElement, parentTag, parentCache, parentIndex, data, cached, shouldReattach, index, editable, namespace, configs) { - if (data === undefined) return undefined - if (data === null) data = "" + if (data === undefined || data === null) data = "" if (data.subtree === "retain") return cached var cachedType = type.call(cached), dataType = type.call(data)