Skip diff for cached, non-keyed nodes fix #1206

This commit is contained in:
Pierre-Yves Gerardy 2016-08-06 00:09:48 +02:00
parent 4b340ecd75
commit b6bb63ff85
2 changed files with 20 additions and 2 deletions

View file

@ -845,4 +845,22 @@ o.spec("updateNodes", function() {
o(root.childNodes[0].nodeName).equals("A")
o(root.childNodes[1].nodeName).equals("S")
})
o("cached, non-keyed nodes skip diff", function () {
var onupdate = o.spy();
var cached = {tag:"a", attrs:{onupdate: onupdate}}
render(root, cached)
render(root, cached)
o(onupdate.callCount).equals(0)
})
o("cached, keyed nodes skip diff", function () {
var onupdate = o.spy();
var cached = {tag:"a", key:"a", attrs:{onupdate: onupdate}}
render(root, cached)
render(root, cached)
o(onupdate.callCount).equals(0)
})
})