@@ -62,7 +62,7 @@ exports._initData = function () {
6262 }
6363 if ( this . _props [ prop ] . raw !== null ||
6464 ! optionsData . hasOwnProperty ( prop ) ) {
65- optionsData . $ set( prop , propsData [ prop ] )
65+ _ . set ( optionsData , prop , propsData [ prop ] )
6666 }
6767 }
6868 }
@@ -73,9 +73,7 @@ exports._initData = function () {
7373 i = keys . length
7474 while ( i -- ) {
7575 key = keys [ i ]
76- if ( ! _ . isReserved ( key ) ) {
77- this . _proxy ( key )
78- }
76+ this . _proxy ( key )
7977 }
8078 // observe data
8179 Observer . create ( data , this )
@@ -97,7 +95,7 @@ exports._setData = function (newData) {
9795 i = keys . length
9896 while ( i -- ) {
9997 key = keys [ i ]
100- if ( ! _ . isReserved ( key ) && ! ( key in newData ) ) {
98+ if ( ! ( key in newData ) ) {
10199 this . _unproxy ( key )
102100 }
103101 }
@@ -107,7 +105,7 @@ exports._setData = function (newData) {
107105 i = keys . length
108106 while ( i -- ) {
109107 key = keys [ i ]
110- if ( ! this . hasOwnProperty ( key ) && ! _ . isReserved ( key ) ) {
108+ if ( ! this . hasOwnProperty ( key ) ) {
111109 // new property
112110 this . _proxy ( key )
113111 }
@@ -125,20 +123,23 @@ exports._setData = function (newData) {
125123 */
126124
127125exports . _proxy = function ( key ) {
128- // need to store ref to self here
129- // because these getter/setters might
130- // be called by child instances!
131- var self = this
132- Object . defineProperty ( self , key , {
133- configurable : true ,
134- enumerable : true ,
135- get : function proxyGetter ( ) {
136- return self . _data [ key ]
137- } ,
138- set : function proxySetter ( val ) {
139- self . _data [ key ] = val
140- }
141- } )
126+ if ( ! _ . isReserved ( key ) ) {
127+ // need to store ref to self here
128+ // because these getter/setters might
129+ // be called by child scopes via
130+ // prototype inheritance.
131+ var self = this
132+ Object . defineProperty ( self , key , {
133+ configurable : true ,
134+ enumerable : true ,
135+ get : function proxyGetter ( ) {
136+ return self . _data [ key ]
137+ } ,
138+ set : function proxySetter ( val ) {
139+ self . _data [ key ] = val
140+ }
141+ } )
142+ }
142143}
143144
144145/**
@@ -148,7 +149,9 @@ exports._proxy = function (key) {
148149 */
149150
150151exports . _unproxy = function ( key ) {
151- delete this [ key ]
152+ if ( ! _ . isReserved ( key ) ) {
153+ delete this [ key ]
154+ }
152155}
153156
154157/**
0 commit comments