From 94d804d850fd68f4564244c3f7a63cfe95ad0d6f Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 14 Apr 2015 22:47:56 -0400 Subject: [PATCH] #554 don't initialize ctx.retain --- mithril.js | 2 +- tests/mithril-tests.js | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/mithril.js b/mithril.js index 95b9d0e9..52529047 100644 --- a/mithril.js +++ b/mithril.js @@ -318,7 +318,7 @@ var m = (function app(window, undefined) { } //schedule configs to be called. They are called after `build` finishes running if (typeof data.attrs["config"] === FUNCTION) { - var context = cached.configContext = cached.configContext || {retain: (m.redraw.strategy() == "diff") || undefined}; + var context = cached.configContext = cached.configContext || {}; // bind var callback = function(data, args) { diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index 0552e1ef..71968fbf 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -2829,48 +2829,6 @@ function testMithril(mock) { mock.requestAnimationFrame.$resolve() mock.location.search = "?" - var root = mock.document.createElement("div") - var value - - var a = {} - a.controller = function() {} - a.view = function() { - return m("a", {config: function(el, init, ctx) { - value = ctx.retain - }}) - } - - m.route(root, "/a", { - "/a": a - }) - - return !value - }) - test(function() { - mock.requestAnimationFrame.$resolve() - mock.location.search = "?" - - var root = mock.document.createElement("div") - var value - - var a = {} - a.controller = function() {m.redraw.strategy("diff")} - a.view = function() { - return m("a", {config: function(el, init, ctx) { - value = ctx.retain - }}) - } - - m.route(root, "/a", { - "/a": a - }) - - return value - }) - test(function() { - mock.requestAnimationFrame.$resolve() - mock.location.search = "?" - var root = mock.document.createElement("div") var initCount = 0