Skip to content

Commit

Permalink
fix(observer): do not invoke getters on initial observation (#7302)
Browse files Browse the repository at this point in the history
fix #7280
  • Loading branch information
DeyLak authored and yyx990803 committed Mar 7, 2018
1 parent f7311c9 commit 7392dfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/observer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class Observer {
walk (obj: Object) {
const keys = Object.keys(obj)
for (let i = 0; i < keys.length; i++) {
defineReactive(obj, keys[i], obj[keys[i]])
defineReactive(obj, keys[i])
}
}

Expand Down Expand Up @@ -145,6 +145,9 @@ export function defineReactive (

// cater for pre-defined getter/setters
const getter = property && property.get
if (!getter && arguments.length === 2) {
val = obj[key]
}
const setter = property && property.set

let childOb = !shallow && observe(val)
Expand Down

0 comments on commit 7392dfc

Please sign in to comment.