File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11var batcher = require ( './batcher' ) ,
2+ utils = require ( './utils' ) ,
23 id = 0
34
45/**
@@ -28,7 +29,9 @@ var BindingProto = Binding.prototype
2829 * Update value and queue instance updates.
2930 */
3031BindingProto . update = function ( value ) {
31- if ( arguments . length ) this . value = value
32+ if ( ! this . isComputed || this . isFn ) {
33+ this . value = value
34+ }
3235 batcher . queue ( this )
3336}
3437
Original file line number Diff line number Diff line change @@ -500,18 +500,17 @@ CompilerProto.define = function (key, binding) {
500500 }
501501
502502 Object . defineProperty ( vm , key , {
503- enumerable : ! binding . isComputed ,
504503 get : binding . isComputed
505504 ? function ( ) {
506- return compiler . data [ key ] . $get ( )
505+ return binding . value . $get ( )
507506 }
508507 : function ( ) {
509508 return compiler . data [ key ]
510509 } ,
511510 set : binding . isComputed
512511 ? function ( val ) {
513- if ( compiler . data [ key ] . $set ) {
514- compiler . data [ key ] . $set ( val )
512+ if ( binding . value . $set ) {
513+ binding . value . $set ( val )
515514 }
516515 }
517516 : function ( val ) {
@@ -529,9 +528,11 @@ CompilerProto.markComputed = function (binding) {
529528 binding . isComputed = true
530529 // bind the accessors to the vm
531530 if ( ! binding . isFn ) {
532- value . $get = utils . bind ( value . $get , vm )
531+ binding . value = {
532+ $get : utils . bind ( value . $get , vm )
533+ }
533534 if ( value . $set ) {
534- value . $set = utils . bind ( value . $set , vm )
535+ binding . value . $set = utils . bind ( value . $set , vm )
535536 }
536537 }
537538 // keep track for dep parsing later
You can’t perform that action at this time.
0 commit comments