@@ -24,7 +24,6 @@ import { orderWatchers } from './order-watchers'
24
24
25
25
export default class Wrapper implements BaseWrapper {
26
26
+ vnode : VNode | null ;
27
- _vnode : VNode | null ;
28
27
+ vm : Component | null ;
29
28
_emitted : { [ name : string ] : Array < Array < any > > } ;
30
29
_emittedByOrder: Array < { name : string , args : Array < any > } > ;
@@ -40,28 +39,27 @@ export default class Wrapper implements BaseWrapper {
40
39
const element = node instanceof Element ? node : node . elm
41
40
// Prevent redefine by VueWrapper
42
41
if ( this . constructor . name === 'Wrapper' ) {
43
- this . _vnode = vnode
44
42
// $FlowIgnore
45
43
Object . defineProperty ( this , 'vnode' , {
46
- get : ( ) => this . _vnode ,
47
- set : ( ) => throwError ( `Wrapper .vnode is read-only` )
44
+ get : ( ) => vnode ,
45
+ set : ( ) => throwError ( 'wrapper .vnode is read-only' )
48
46
} )
49
47
// $FlowIgnore
50
48
Object . defineProperty ( this , 'element' , {
51
49
get : ( ) => element ,
52
- set : ( ) => throwError ( `Wrapper .element is read-only` )
50
+ set : ( ) => throwError ( 'wrapper .element is read-only' )
53
51
} )
54
52
// $FlowIgnore
55
53
Object . defineProperty ( this , 'vm' , {
56
54
get : ( ) => undefined ,
57
- set : ( ) => throwError ( `Wrapper .vm is read-only` )
55
+ set : ( ) => throwError ( 'wrapper .vm is read-only' )
58
56
} )
59
57
}
60
58
const frozenOptions = Object . freeze ( options )
61
59
// $FlowIgnore
62
60
Object . defineProperty ( this , 'options' , {
63
61
get : ( ) => frozenOptions ,
64
- set : ( ) => throwError ( ` ${ this . constructor . name } . options is read-only` )
62
+ set : ( ) => throwError ( 'wrapper. options is read-only' )
65
63
} )
66
64
if (
67
65
this . vnode &&
@@ -313,7 +311,7 @@ export default class Wrapper implements BaseWrapper {
313
311
mockElement . style [ style ] = value
314
312
315
313
if ( ! this . options . attachedToDocument && ( this . vm || this . vnode ) ) {
316
- // $FlowIgnore : Possible null value, will be removed in 1.0.0
314
+ // $FlowIgnore
317
315
const vm = this . vm || this . vnode . context . $root
318
316
body . insertBefore ( vm . $root . _vnode . elm , null )
319
317
}
@@ -668,7 +666,6 @@ export default class Wrapper implements BaseWrapper {
668
666
} )
669
667
670
668
// $FlowIgnore : Problem with possibly null this.vm
671
- this . _vnode = this . vm . _vnode
672
669
orderWatchers ( this . vm || this . vnode . context . $root )
673
670
Vue . config . silent = originalConfig
674
671
}
0 commit comments