@@ -105,24 +105,27 @@ export function createFunctionalComponent (
105
105
const vnode = options . render . call ( null , renderContext . _c , renderContext )
106
106
107
107
if ( vnode instanceof VNode ) {
108
- return cloneAndMarkFunctionalResult ( vnode , data , renderContext . parent , options )
108
+ return cloneAndMarkFunctionalResult ( vnode , data , renderContext . parent , options , renderContext )
109
109
} else if ( Array . isArray ( vnode ) ) {
110
110
const vnodes = normalizeChildren ( vnode ) || [ ]
111
111
const res = new Array ( vnodes . length )
112
112
for ( let i = 0 ; i < vnodes . length ; i ++ ) {
113
- res [ i ] = cloneAndMarkFunctionalResult ( vnodes [ i ] , data , renderContext . parent , options )
113
+ res [ i ] = cloneAndMarkFunctionalResult ( vnodes [ i ] , data , renderContext . parent , options , renderContext )
114
114
}
115
115
return res
116
116
}
117
117
}
118
118
119
- function cloneAndMarkFunctionalResult ( vnode , data , contextVm , options ) {
119
+ function cloneAndMarkFunctionalResult ( vnode , data , contextVm , options , renderContext ) {
120
120
// #7817 clone node before setting fnContext, otherwise if the node is reused
121
121
// (e.g. it was from a cached normal slot) the fnContext causes named slots
122
122
// that should not be matched to match.
123
123
const clone = cloneVNode ( vnode )
124
124
clone . fnContext = contextVm
125
125
clone . fnOptions = options
126
+ if ( process . env . NODE_ENV !== 'production' ) {
127
+ ; ( clone . devtoolsMeta = clone . devtoolsMeta || { } ) . renderContext = renderContext
128
+ }
126
129
if ( data . slot ) {
127
130
( clone . data || ( clone . data = { } ) ) . slot = data . slot
128
131
}
0 commit comments