#554 don't initialize ctx.retain

This commit is contained in:
Leo Horie 2015-04-14 22:47:56 -04:00
parent e7992553d9
commit 94d804d850
2 changed files with 1 additions and 43 deletions

View file

@ -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) {

View file

@ -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