Merge pull request #1517 from barneycarroll/object-create-component
Avoid intermediary component constructor
This commit is contained in:
commit
74ded82165
1 changed files with 1 additions and 6 deletions
|
|
@ -95,12 +95,7 @@ module.exports = function($window) {
|
||||||
return element
|
return element
|
||||||
}
|
}
|
||||||
function createComponent(vnode, hooks, ns) {
|
function createComponent(vnode, hooks, ns) {
|
||||||
// For object literals since `Vnode()` always sets the `state` field.
|
vnode.state = Object.create(vnode.tag)
|
||||||
if (!vnode.state) vnode.state = {}
|
|
||||||
var constructor = function() {}
|
|
||||||
constructor.prototype = vnode.tag
|
|
||||||
vnode.state = new constructor
|
|
||||||
|
|
||||||
var view = vnode.tag.view
|
var view = vnode.tag.view
|
||||||
if (view.reentrantLock != null) return $emptyFragment
|
if (view.reentrantLock != null) return $emptyFragment
|
||||||
view.reentrantLock = true
|
view.reentrantLock = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue