]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: remove unnecessary code
authordaiwei <daiwei521@126.com>
Wed, 13 Aug 2025 08:40:20 +0000 (16:40 +0800)
committerdaiwei <daiwei521@126.com>
Wed, 13 Aug 2025 08:40:20 +0000 (16:40 +0800)
packages/runtime-vapor/src/dom/hydration.ts

index 389f9a95c6d26f94b2387d2f7347132451e96ad7..469d1be453cef3679885e0f247027404aac3567b 100644 (file)
@@ -70,8 +70,7 @@ function performHydration<T>(
 }
 
 export function withHydration(container: ParentNode, fn: () => void): void {
-  // @ts-expect-error
-  const setup = () => setInsertionState(container, -1)
+  const setup = () => setInsertionState(container)
   const cleanup = () => resetInsertionState()
   return performHydration(fn, setup, cleanup)
 }
@@ -138,11 +137,7 @@ function adoptTemplateImpl(node: Node, template: string): Node | null {
 
 function locateHydrationNodeImpl(): void {
   let node: Node | null
-  // @ts-expect-error
-  if (insertionAnchor === -1) {
-    // firstChild
-    node = _child(insertionParent!)!
-  } else if (insertionAnchor === 0) {
+  if (insertionAnchor === 0) {
     // prepend
     node = insertionParent!.$pa = locateHydrationNodeByAnchor(
       insertionParent!.$pa || _child(insertionParent!),