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 1
1
var batcher = require ( './batcher' ) ,
2
+ utils = require ( './utils' ) ,
2
3
id = 0
3
4
4
5
/**
@@ -28,7 +29,9 @@ var BindingProto = Binding.prototype
28
29
* Update value and queue instance updates.
29
30
*/
30
31
BindingProto . update = function ( value ) {
31
- if ( arguments . length ) this . value = value
32
+ if ( ! this . isComputed || this . isFn ) {
33
+ this . value = value
34
+ }
32
35
batcher . queue ( this )
33
36
}
34
37
Original file line number Diff line number Diff line change @@ -500,18 +500,17 @@ CompilerProto.define = function (key, binding) {
500
500
}
501
501
502
502
Object . defineProperty ( vm , key , {
503
- enumerable : ! binding . isComputed ,
504
503
get : binding . isComputed
505
504
? function ( ) {
506
- return compiler . data [ key ] . $get ( )
505
+ return binding . value . $get ( )
507
506
}
508
507
: function ( ) {
509
508
return compiler . data [ key ]
510
509
} ,
511
510
set : binding . isComputed
512
511
? function ( val ) {
513
- if ( compiler . data [ key ] . $set ) {
514
- compiler . data [ key ] . $set ( val )
512
+ if ( binding . value . $set ) {
513
+ binding . value . $set ( val )
515
514
}
516
515
}
517
516
: function ( val ) {
@@ -529,9 +528,11 @@ CompilerProto.markComputed = function (binding) {
529
528
binding . isComputed = true
530
529
// bind the accessors to the vm
531
530
if ( ! binding . isFn ) {
532
- value . $get = utils . bind ( value . $get , vm )
531
+ binding . value = {
532
+ $get : utils . bind ( value . $get , vm )
533
+ }
533
534
if ( value . $set ) {
534
- value . $set = utils . bind ( value . $set , vm )
535
+ binding . value . $set = utils . bind ( value . $set , vm )
535
536
}
536
537
}
537
538
// keep track for dep parsing later
You can’t perform that action at this time.
0 commit comments