Revert "don't copy state anymore"

This reverts commit cece44d4ac.
This commit is contained in:
Leo Horie 2016-07-08 10:24:48 -04:00
parent cece44d4ac
commit a988276e9b
4 changed files with 42 additions and 8 deletions

View file

@ -576,4 +576,22 @@ o.spec("component", function() {
o(vnode.dom).notEquals(updated.dom)
})
})
o.spec("state", function() {
o("deep copies state", function() {
var called = 0
var component = {
data: [{a: 1}],
oninit: init,
view: function() {
return ""
}
}
render(root, [{tag: component}])
function init(vnode) {
o(vnode.state.data).deepEquals([{a: 1}])
}
})
})
})