浏览代码

fix(runtime-dom): simplify moveNode feature detection logic

daiwei 3 月之前
父节点
当前提交
c1038582b4
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      packages/runtime-dom/src/nodeOps.ts

+ 1 - 2
packages/runtime-dom/src/nodeOps.ts

@@ -54,8 +54,7 @@ export const moveNode: (
   anchor: Node | null,
 ) => void =
   /*@__PURE__*/ (() =>
-    (__TEST__ ? typeof HTMLElement !== 'undefined' : true) &&
-    'moveBefore' in HTMLElement.prototype
+    typeof HTMLElement !== 'undefined' && 'moveBefore' in HTMLElement.prototype
       ? (parent, child, anchor) => parent.moveBefore!(child, anchor)
       : (parent, child, anchor) => parent.insertBefore(child, anchor))()