File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ import {
1111 getCurrentInstance ,
1212 h ,
1313 inject ,
14+ nextTick ,
1415 nodeOps ,
1516 provide ,
1617 ref ,
1718 render ,
1819 serializeInner ,
20+ toRaw ,
1921 toRefs ,
2022 watch ,
2123} from '@vue/runtime-test'
22- import { render as domRender , nextTick } from 'vue'
24+ import { render as domRender } from 'vue'
2325
2426describe ( 'component props' , ( ) => {
2527 test ( 'stateful' , ( ) => {
@@ -127,12 +129,12 @@ describe('component props', () => {
127129 render ( h ( Comp , { foo : 1 } ) , root )
128130 expect ( props ) . toEqual ( { foo : 1 } )
129131 expect ( attrs ) . toEqual ( { foo : 1 } )
130- expect ( props ) . toBe ( attrs )
132+ expect ( toRaw ( props ) ) . toBe ( attrs )
131133
132134 render ( h ( Comp , { bar : 2 } ) , root )
133135 expect ( props ) . toEqual ( { bar : 2 } )
134136 expect ( attrs ) . toEqual ( { bar : 2 } )
135- expect ( props ) . toBe ( attrs )
137+ expect ( toRaw ( props ) ) . toBe ( attrs )
136138 } )
137139
138140 test ( 'boolean casting' , ( ) => {
Original file line number Diff line number Diff line change @@ -55,12 +55,12 @@ export function renderComponentRoot(
5555 emit,
5656 render,
5757 renderCache,
58+ props,
5859 data,
5960 setupState,
6061 ctx,
6162 inheritAttrs,
6263 } = instance
63- const props = __DEV__ ? shallowReadonly ( instance . props ) : instance . props
6464 const prev = setCurrentRenderingInstance ( instance )
6565
6666 let result
@@ -94,7 +94,7 @@ export function renderComponentRoot(
9494 thisProxy ,
9595 proxyToUse ! ,
9696 renderCache ,
97- props ,
97+ __DEV__ ? shallowReadonly ( props ) : props ,
9898 setupState ,
9999 data ,
100100 ctx ,
@@ -111,7 +111,7 @@ export function renderComponentRoot(
111111 result = normalizeVNode (
112112 render . length > 1
113113 ? render (
114- props ,
114+ __DEV__ ? shallowReadonly ( props ) : props ,
115115 __DEV__
116116 ? {
117117 get attrs ( ) {
@@ -123,7 +123,10 @@ export function renderComponentRoot(
123123 }
124124 : { attrs, slots, emit } ,
125125 )
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+ ) ,
127130 )
128131 fallthroughAttrs = Component . props
129132 ? attrs
You can’t perform that action at this time.
0 commit comments