early return in vdom update modules

This commit is contained in:
Evan You 2016-04-19 11:07:57 -04:00
parent dc183eda1f
commit 95a9282b20
4 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,9 @@ const xlinkNS = 'http://www.w3.org/1999/xlink'
const isXlink = name => name.slice(0, 6) === 'xlink:'
function updateAttrs (oldVnode, vnode) {
if (!oldVnode.data.attrs && !vnode.data.attrs) {
return
}
let key, cur, old
const elm = vnode.elm
const oldAttrs = oldVnode.data.attrs || {}

View File

@ -1,6 +1,9 @@
import { updateListeners } from '../../vdom/helpers'
function updateDOMListeners (oldVnode, vnode) {
if (!oldVnode.data.on && !vnode.data.on) {
return
}
const on = vnode.data.on
const oldOn = oldVnode.data.on || {}
updateListeners(on, oldOn, (event, handler, capture) => {

View File

@ -1,4 +1,7 @@
function updateProps (oldVnode, vnode) {
if (!oldVnode.data.props && !vnode.data.props) {
return
}
let key, cur, old
const elm = vnode.elm
const oldProps = oldVnode.data.props || {}

View File

@ -29,6 +29,9 @@ function toObject (arr) {
}
function updateStyle (oldVnode, vnode) {
if (!oldVnode.data.style && !vnode.data.style) {
return
}
let cur, name
const elm = vnode.elm
const oldStyle = oldVnode.data.style || {}