Merge pull request #190 from oleg8sh/patch-2

typeof is much faster than {}.toString()
This commit is contained in:
Leo Horie 2014-08-08 17:14:09 -04:00
commit d71bac33f3

View file

@ -153,7 +153,7 @@ Mithril = m = new function app(window, undefined) {
cached.nodes.intact = true
if (shouldReattach === true) parentElement.insertBefore(node, parentElement.childNodes[index] || null)
}
if (type.call(data.attrs["config"]) == "[object Function]") {
if (typeof data.attrs["config"] === "function") {
configs.push(data.attrs["config"].bind(window, node, !isNew, cached.configContext = cached.configContext || {}, cached))
}
}