File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 1
- var _ = require ( '../util' )
2
1
var Watcher = require ( '../watcher' )
3
2
4
3
module . exports = {
@@ -16,25 +15,20 @@ module.exports = {
16
15
// without this it would stabilize too, but this makes
17
16
// sure it doesn't cause other watchers to re-evaluate.
18
17
var locked = false
19
- var lock = function ( ) {
20
- locked = true
21
- _ . nextTick ( unlock )
22
- }
23
- var unlock = function ( ) {
24
- locked = false
25
- }
26
18
27
19
if ( ! prop . oneWayUp ) {
28
20
this . parentWatcher = new Watcher (
29
21
parent ,
30
22
parentKey ,
31
23
function ( val ) {
32
24
if ( ! locked ) {
33
- lock ( )
25
+ locked = true
34
26
// all props have been initialized already
35
27
child [ childKey ] = val
28
+ locked = false
36
29
}
37
- }
30
+ } ,
31
+ { sync : true }
38
32
)
39
33
40
34
// set the child initial value first, before setting
@@ -51,10 +45,12 @@ module.exports = {
51
45
childKey ,
52
46
function ( val ) {
53
47
if ( ! locked ) {
54
- lock ( )
48
+ locked = true
55
49
parent . $set ( parentKey , val )
50
+ locked = false
56
51
}
57
- }
52
+ } ,
53
+ { sync : true }
58
54
)
59
55
60
56
// set initial value for one-way up binding
You can’t perform that action at this time.
0 commit comments