Merge pull request #1517 from barneycarroll/object-create-component

Avoid intermediary component constructor
This commit is contained in:
Leo Horie 2017-01-06 22:36:04 -05:00 committed by GitHub
commit 74ded82165

View file

@ -95,12 +95,7 @@ module.exports = function($window) {
return element
}
function createComponent(vnode, hooks, ns) {
// For object literals since `Vnode()` always sets the `state` field.
if (!vnode.state) vnode.state = {}
var constructor = function() {}
constructor.prototype = vnode.tag
vnode.state = new constructor
vnode.state = Object.create(vnode.tag)
var view = vnode.tag.view
if (view.reentrantLock != null) return $emptyFragment
view.reentrantLock = true