@@ -79,7 +79,19 @@ function _next(node: Node): Node {
79
79
80
80
/*! #__NO_SIDE_EFFECTS__ */
81
81
export function __next ( node : Node ) : Node {
82
- node = handleWrappedNode ( node )
82
+ // process dynamic node (<!--[[-->...<!--]]-->) as a single node
83
+ if ( isComment ( node , DYNAMIC_START_ANCHOR_LABEL ) ) {
84
+ node = locateEndAnchor (
85
+ node ,
86
+ DYNAMIC_START_ANCHOR_LABEL ,
87
+ DYNAMIC_END_ANCHOR_LABEL ,
88
+ ) !
89
+ }
90
+
91
+ // process fragment (<!--[-->...<!--]-->) as a single node
92
+ else if ( isComment ( node , '[' ) ) {
93
+ node = locateEndAnchor ( node ) !
94
+ }
83
95
84
96
let n = node . nextSibling !
85
97
while ( n && isNonHydrationNode ( n ) ) {
@@ -145,7 +157,7 @@ export function disableHydrationNodeLookup(): void {
145
157
146
158
function isNonHydrationNode ( node : Node ) {
147
159
return (
148
- // empty text nodes, no need to hydrate
160
+ // empty text nodes
149
161
isEmptyText ( node ) ||
150
162
// dynamic node anchors (<!--[[-->, <!--]]-->)
151
163
isDynamicAnchor ( node ) ||
@@ -168,21 +180,3 @@ export function findVaporFragmentAnchor(
168
180
169
181
return null
170
182
}
171
-
172
- function handleWrappedNode ( node : Node ) : Node {
173
- // process dynamic node (<!--[[-->...<!--]]-->) as a single one
174
- if ( isComment ( node , DYNAMIC_START_ANCHOR_LABEL ) ) {
175
- return locateEndAnchor (
176
- node ,
177
- DYNAMIC_START_ANCHOR_LABEL ,
178
- DYNAMIC_END_ANCHOR_LABEL ,
179
- ) !
180
- }
181
-
182
- // process fragment (<!--[-->...<!--]-->) as a single one
183
- else if ( isComment ( node , '[' ) ) {
184
- return locateEndAnchor ( node ) !
185
- }
186
-
187
- return node
188
- }
0 commit comments