#1311 don't repeatedly throw the same error if oninit async-redraws and view throws

This commit is contained in:
Leo Horie 2016-11-02 14:56:17 -04:00
parent 36ef994510
commit 3c6e257a19
4 changed files with 68 additions and 35 deletions

View file

@ -95,8 +95,12 @@ module.exports = function($window) {
if (!vnode.state) vnode.state = {}
assign(vnode.state, vnode.tag)
var view = vnode.tag.view
if (view.reentrantLock != null) return $emptyFragment
view.reentrantLock = true
initLifecycle(vnode.tag, vnode, hooks)
vnode.instance = Vnode.normalize(vnode.tag.view.call(vnode.state, vnode))
vnode.instance = Vnode.normalize(view.call(vnode.state, vnode))
view.reentrantLock = null
if (vnode.instance != null) {
if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as arguments")
var element = createNode(vnode.instance, hooks, ns)