@@ -75,13 +75,14 @@ export function diff(
75
75
if ( newVNode . constructor != UNDEFINED ) return NULL ;
76
76
77
77
// If the previous diff bailed out, resume creating/hydrating.
78
- if ( oldVNode . _flags & MODE_SUSPENDED ) {
79
- isHydrating = ! ! ( oldVNode . _flags & MODE_HYDRATE ) ;
80
- if ( oldVNode . _component . _excess ) {
81
- excessDomChildren = oldVNode . _component . _excess ;
82
- oldDom = newVNode . _dom = oldVNode . _dom = excessDomChildren [ 0 ] ;
83
- oldVNode . _component . _excess = null ;
84
- }
78
+ if (
79
+ oldVNode . _flags & MODE_SUSPENDED &&
80
+ // @ts -expect-error This is 1 or 0 (true or false)
81
+ ( isHydrating = oldVNode . _flags & MODE_HYDRATE )
82
+ ) {
83
+ excessDomChildren = oldVNode . _component . _excess ;
84
+ oldDom = excessDomChildren [ 0 ] ;
85
+ oldVNode . _component . _excess = NULL ;
85
86
}
86
87
87
88
if ( ( tmp = options . _diff ) ) tmp ( newVNode ) ;
@@ -311,7 +312,7 @@ export function diff(
311
312
if ( isHydrating || excessDomChildren != NULL ) {
312
313
if ( e . then ) {
313
314
let commentMarkersToFind = 0 ,
314
- done = false ;
315
+ done ;
315
316
316
317
newVNode . _flags |= isHydrating
317
318
? MODE_HYDRATE | MODE_SUSPENDED
@@ -329,21 +330,22 @@ export function diff(
329
330
// We exclude the open and closing marker from
330
331
// the future excessDomChildren but any nested one
331
332
// needs to be included for future suspensions.
332
- if ( child . nodeType == 8 && child . data == '$s' ) {
333
- if ( commentMarkersToFind > 0 ) {
334
- newVNode . _component . _excess . push ( child ) ;
335
- }
336
- commentMarkersToFind ++ ;
337
- excessDomChildren [ i ] = NULL ;
338
- } else if ( child . nodeType == 8 && child . data == '/$s' ) {
339
- commentMarkersToFind -- ;
340
- if ( commentMarkersToFind > 0 ) {
341
- newVNode . _component . _excess . push ( child ) ;
333
+ if ( child . nodeType == 8 ) {
334
+ if ( child . data == '$s' ) {
335
+ if ( commentMarkersToFind ) {
336
+ newVNode . _component . _excess . push ( child ) ;
337
+ }
338
+ commentMarkersToFind ++ ;
339
+ } else if ( child . data == '/$s' ) {
340
+ commentMarkersToFind -- ;
341
+ if ( commentMarkersToFind ) {
342
+ newVNode . _component . _excess . push ( child ) ;
343
+ }
344
+ done = commentMarkersToFind == 0 ;
345
+ oldDom = excessDomChildren [ i ] ;
342
346
}
343
- done = commentMarkersToFind === 0 ;
344
- oldDom = excessDomChildren [ i ] ;
345
347
excessDomChildren [ i ] = NULL ;
346
- } else if ( commentMarkersToFind > 0 ) {
348
+ } else if ( commentMarkersToFind ) {
347
349
newVNode . _component . _excess . push ( child ) ;
348
350
excessDomChildren [ i ] = NULL ;
349
351
}
0 commit comments