From c57b0b4047f3af4ee3b1d17807b8b8d77a5f58bf Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 9 Jun 2015 16:27:57 -0500 Subject: [PATCH] prevent nonsensical IE error --- mithril.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index 131fc41c..cd79c442 100644 --- a/mithril.js +++ b/mithril.js @@ -364,8 +364,11 @@ var m = (function app(window, undefined) { clear(cached.nodes, cached); nodes = [$document.createTextNode(data)] } - try {parentElement.insertBefore(nodes[0], parentElement.childNodes[index] || null);} catch (e) {} //IE erroneously throws error when appending an empty text node after a null - nodes[0].nodeValue = data + try { + parentElement.insertBefore(nodes[0], parentElement.childNodes[index] || null); + nodes[0].nodeValue = data + } + catch (e) {} //IE erroneously throws error when appending an empty text node after a null } } }