lhorie/mithril.js — pull request #185 by oleg8sh (2014-08-07 22:13:17+00:00)
Title: Don't rely on {}.toString() in old browsers (IE<=8)

As you know, toString() method called on null returns "[object Null]", and on undefined returns "[object Undefined]".
But this is true for ECMAScript 5.1 and above.

Older browsers in both cases returns window.toString() that is "[object Object]".

So m("br") fails in IE8 when it tries to get hasAttrs variable value.

The same troubles can be found in build() if cached is undefined.

More info: http://tobyho.com/2011/01/28/checking-types-in-javascript/

P.S.: Changes in line 37 "... cached === null || cached === undefined ..." is also an alternative solution of #162
( https://github.com/lhorie/mithril.js/issues/162 )