@@ -202,35 +202,31 @@ export function h<P>(
202
202
203
203
// Actual implementation
204
204
export function h ( type : any , propsOrChildren ?: any , children ?: any ) : VNode {
205
- // #6913 disable tracking block in h function
206
- const doCreateVNode = ( type : any , props ?: any , children ?: any ) => {
205
+ try {
206
+ // #6913 disable tracking block in h function
207
207
setBlockTracking ( - 1 )
208
- try {
209
- return createVNode ( type , props , children )
210
- } finally {
211
- setBlockTracking ( 1 )
212
- }
213
- }
214
-
215
- const l = arguments . length
216
- if ( l === 2 ) {
217
- if ( isObject ( propsOrChildren ) && ! isArray ( propsOrChildren ) ) {
218
- // single vnode without props
219
- if ( isVNode ( propsOrChildren ) ) {
220
- return doCreateVNode ( type , null , [ propsOrChildren ] )
208
+ const l = arguments . length
209
+ if ( l === 2 ) {
210
+ if ( isObject ( propsOrChildren ) && ! isArray ( propsOrChildren ) ) {
211
+ // single vnode without props
212
+ if ( isVNode ( propsOrChildren ) ) {
213
+ return createVNode ( type , null , [ propsOrChildren ] )
214
+ }
215
+ // props without children
216
+ return createVNode ( type , propsOrChildren )
217
+ } else {
218
+ // omit props
219
+ return createVNode ( type , null , propsOrChildren )
221
220
}
222
- // props without children
223
- return doCreateVNode ( type , propsOrChildren )
224
221
} else {
225
- // omit props
226
- return doCreateVNode ( type , null , propsOrChildren )
227
- }
228
- } else {
229
- if ( l > 3 ) {
230
- children = Array . prototype . slice . call ( arguments , 2 )
231
- } else if ( l === 3 && isVNode ( children ) ) {
232
- children = [ children ]
222
+ if ( l > 3 ) {
223
+ children = Array . prototype . slice . call ( arguments , 2 )
224
+ } else if ( l === 3 && isVNode ( children ) ) {
225
+ children = [ children ]
226
+ }
227
+ return createVNode ( type , propsOrChildren , children )
233
228
}
234
- return doCreateVNode ( type , propsOrChildren , children )
229
+ } finally {
230
+ setBlockTracking ( 1 )
235
231
}
236
232
}
0 commit comments