Reverse hook order for all but onbeforeupdate (#2297)

- Drive-by: `onbeforeupdate` prevents subtree redraw if *either* hook
  returns `false`, not *both*.
This commit is contained in:
Isiah Meadows 2018-11-27 18:02:48 -05:00 committed by GitHub
parent c33621cd52
commit a8473e63c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 33 deletions

View file

@ -186,7 +186,7 @@ o.spec("onbeforeupdate", function() {
o(root.firstChild.attributes["id"].value).equals("b")
})
o("does not prevent update if returning false in component but true in vnode", function() {
o("prevents update if returning false in component but true in vnode", function() {
var component = createComponent({
onbeforeupdate: function() {return false},
view: function(vnode) {
@ -199,10 +199,10 @@ o.spec("onbeforeupdate", function() {
render(root, [vnode])
render(root, [updated])
o(root.firstChild.attributes["id"].value).equals("b")
o(root.firstChild.attributes["id"].value).equals("a")
})
o("does not prevent update if returning true in component but false in vnode", function() {
o("prevents update if returning true in component but false in vnode", function() {
var component = createComponent({
onbeforeupdate: function() {return true},
view: function(vnode) {
@ -215,7 +215,7 @@ o.spec("onbeforeupdate", function() {
render(root, [vnode])
render(root, [updated])
o(root.firstChild.attributes["id"].value).equals("b")
o(root.firstChild.attributes["id"].value).equals("a")
})
o("does not prevent update if returning true from component", function() {