#554 don't initialize ctx.retain
This commit is contained in:
parent
e7992553d9
commit
94d804d850
2 changed files with 1 additions and 43 deletions
|
|
@ -318,7 +318,7 @@ var m = (function app(window, undefined) {
|
||||||
}
|
}
|
||||||
//schedule configs to be called. They are called after `build` finishes running
|
//schedule configs to be called. They are called after `build` finishes running
|
||||||
if (typeof data.attrs["config"] === FUNCTION) {
|
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
|
// bind
|
||||||
var callback = function(data, args) {
|
var callback = function(data, args) {
|
||||||
|
|
|
||||||
|
|
@ -2829,48 +2829,6 @@ function testMithril(mock) {
|
||||||
mock.requestAnimationFrame.$resolve()
|
mock.requestAnimationFrame.$resolve()
|
||||||
mock.location.search = "?"
|
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 root = mock.document.createElement("div")
|
||||||
var initCount = 0
|
var initCount = 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue