From 4c7a87e2ef9c76b5b75d85102662a27165a23ec7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 9 Sep 2016 13:54:24 +0200 Subject: [PATCH] observer conversion enumeration should not include prototype properties --- src/core/observer/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/observer/index.js b/src/core/observer/index.js index 29a12d55..df734dbf 100644 --- a/src/core/observer/index.js +++ b/src/core/observer/index.js @@ -58,9 +58,9 @@ export class Observer { * value type is Object. */ walk (obj: Object) { - const val = this.value - for (const key in obj) { - defineReactive(val, key, obj[key]) + const keys = Object.keys(obj) + for (let i = 0; i < keys.length; i++) { + defineReactive(obj, keys[i], obj[keys[i]]) } }