File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ import {
11
11
getCurrentInstance ,
12
12
h ,
13
13
inject ,
14
+ nextTick ,
14
15
nodeOps ,
15
16
provide ,
16
17
ref ,
17
18
render ,
18
19
serializeInner ,
20
+ toRaw ,
19
21
toRefs ,
20
22
watch ,
21
23
} from '@vue/runtime-test'
22
- import { render as domRender , nextTick } from 'vue'
24
+ import { render as domRender } from 'vue'
23
25
24
26
describe ( 'component props' , ( ) => {
25
27
test ( 'stateful' , ( ) => {
@@ -127,12 +129,12 @@ describe('component props', () => {
127
129
render ( h ( Comp , { foo : 1 } ) , root )
128
130
expect ( props ) . toEqual ( { foo : 1 } )
129
131
expect ( attrs ) . toEqual ( { foo : 1 } )
130
- expect ( props ) . toBe ( attrs )
132
+ expect ( toRaw ( props ) ) . toBe ( attrs )
131
133
132
134
render ( h ( Comp , { bar : 2 } ) , root )
133
135
expect ( props ) . toEqual ( { bar : 2 } )
134
136
expect ( attrs ) . toEqual ( { bar : 2 } )
135
- expect ( props ) . toBe ( attrs )
137
+ expect ( toRaw ( props ) ) . toBe ( attrs )
136
138
} )
137
139
138
140
test ( 'boolean casting' , ( ) => {
Original file line number Diff line number Diff line change @@ -55,12 +55,12 @@ export function renderComponentRoot(
55
55
emit,
56
56
render,
57
57
renderCache,
58
+ props,
58
59
data,
59
60
setupState,
60
61
ctx,
61
62
inheritAttrs,
62
63
} = instance
63
- const props = __DEV__ ? shallowReadonly ( instance . props ) : instance . props
64
64
const prev = setCurrentRenderingInstance ( instance )
65
65
66
66
let result
@@ -94,7 +94,7 @@ export function renderComponentRoot(
94
94
thisProxy ,
95
95
proxyToUse ! ,
96
96
renderCache ,
97
- props ,
97
+ __DEV__ ? shallowReadonly ( props ) : props ,
98
98
setupState ,
99
99
data ,
100
100
ctx ,
@@ -111,7 +111,7 @@ export function renderComponentRoot(
111
111
result = normalizeVNode (
112
112
render . length > 1
113
113
? render (
114
- props ,
114
+ __DEV__ ? shallowReadonly ( props ) : props ,
115
115
__DEV__
116
116
? {
117
117
get attrs ( ) {
@@ -123,7 +123,10 @@ export function renderComponentRoot(
123
123
}
124
124
: { attrs, slots, emit } ,
125
125
)
126
- : render ( props , null as any /* we know it doesn't need it */ ) ,
126
+ : render (
127
+ __DEV__ ? shallowReadonly ( props ) : props ,
128
+ null as any /* we know it doesn't need it */ ,
129
+ ) ,
127
130
)
128
131
fallthroughAttrs = Component . props
129
132
? attrs
You can’t perform that action at this time.
0 commit comments