Avoid creating intermediary constructor in component state creation
This commit is contained in:
parent
baa630f2a6
commit
a19eae2792
1 changed files with 1 additions and 4 deletions
|
|
@ -96,10 +96,7 @@ module.exports = function($window) {
|
||||||
}
|
}
|
||||||
function createComponent(vnode, hooks, ns) {
|
function createComponent(vnode, hooks, ns) {
|
||||||
// For object literals since `Vnode()` always sets the `state` field.
|
// For object literals since `Vnode()` always sets the `state` field.
|
||||||
if (!vnode.state) vnode.state = {}
|
if (!vnode.state) vnode.state = Object.create(vnode.tag)
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue