From 0c6c748d9df45341b5c787e9401c32536161feca Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 16 Apr 2016 02:30:04 -0400 Subject: [PATCH] use more descriptive function names --- src/runtime/instance/render.js | 6 +++--- src/runtime/vdom/component.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/instance/render.js b/src/runtime/instance/render.js index e56b66ad..58dc2468 100644 --- a/src/runtime/instance/render.js +++ b/src/runtime/instance/render.js @@ -40,7 +40,7 @@ export function renderMixin (Vue) { } } - Vue.prototype._tryUpdate = function (parentData, children, key) { + Vue.prototype._updateFromParent = function (parentData, children, key) { const oldParentData = this.$options._renderData this.$options._renderKey = key this.$options._renderData = parentData @@ -54,7 +54,7 @@ export function renderMixin (Vue) { } // diff parent data (attrs on the placeholder) and queue update // if anything changed - if (diffParentData(parentData, oldParentData)) { + if (parentDataChanged(parentData, oldParentData)) { this.$forceUpdate() } } @@ -123,7 +123,7 @@ function resolveSlots (vm, children) { } } -function diffParentData (data, oldData) { +function parentDataChanged (data, oldData) { const keys = Object.keys(oldData) let key, old, cur, i, l, j, k for (i = 0, l = keys.length; i < l; i++) { diff --git a/src/runtime/vdom/component.js b/src/runtime/vdom/component.js index b7915cfa..722443c5 100644 --- a/src/runtime/vdom/component.js +++ b/src/runtime/vdom/component.js @@ -45,7 +45,7 @@ function prepatch (oldVnode, vnode) { cur.child = old.child // try re-render child. the child may optimize it // and just does nothing. - old.child._tryUpdate(cur.data, cur.children, vnode.key) + old.child._updateFromParent(cur.data, cur.children, vnode.key) } }