Merge pull request #692 from pelonpelon/patch-15

mithril.js: fix if clause that expects truthy value. issue: #689
This commit is contained in:
Leo Horie 2015-06-29 09:34:52 -04:00
commit dbc3bc81e4

View file

@ -248,7 +248,7 @@ var m = (function app(window, undefined) {
var key = data && data.attrs && data.attrs.key;
data = (pendingRequests == 0 || forcing) || (cached && cached.controllers && cached.controllers.indexOf(controller) > -1) ? data.view(controller) : {tag: "placeholder"};
if (data.subtree === "retain") return cached;
if (key) {
if (typeof key !== 'undefined' && key !== null) {
if (!data.attrs) data.attrs = {};
data.attrs.key = key;
}