Fix keys, normalize holes (#2452)
* Fix #2434 * Treat holes as unkeyed, normalize boolean/null/undefined This brings a lot better consistency with that API, even though it's slightly breaking. (I had to update a bunch of tests to correspond with it.) * Fill in PR number [skip ci]
This commit is contained in:
parent
86d64e213f
commit
6c562d2b9b
12 changed files with 200 additions and 182 deletions
|
|
@ -34,24 +34,22 @@ o.spec("normalize", function() {
|
|||
var node = Vnode.normalize(1)
|
||||
|
||||
o(node.tag).equals("#")
|
||||
o(node.children).equals(1)
|
||||
o(node.children).equals("1")
|
||||
})
|
||||
o("normalizes falsy number into text node", function() {
|
||||
var node = Vnode.normalize(0)
|
||||
|
||||
o(node.tag).equals("#")
|
||||
o(node.children).equals(0)
|
||||
o(node.children).equals("0")
|
||||
})
|
||||
o("normalizes boolean into text node", function() {
|
||||
o("normalizes `true` to `null`", function() {
|
||||
var node = Vnode.normalize(true)
|
||||
|
||||
o(node.tag).equals("#")
|
||||
o(node.children).equals(true)
|
||||
o(node).equals(null)
|
||||
})
|
||||
o("normalizes falsy boolean into empty text node", function() {
|
||||
o("normalizes `false` to `null`", function() {
|
||||
var node = Vnode.normalize(false)
|
||||
|
||||
o(node.tag).equals("#")
|
||||
o(node.children).equals("")
|
||||
o(node).equals(null)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue