Преглед изворни кода

chore(runtime-vapor): remove test-only custom element unmount fallback

daiwei пре 1 недеља
родитељ
комит
13454a7495
1 измењених фајлова са 2 додато и 17 уклоњено
  1. 2 17
      packages/runtime-vapor/src/apiDefineCustomElement.ts

+ 2 - 17
packages/runtime-vapor/src/apiDefineCustomElement.ts

@@ -255,23 +255,8 @@ export class VaporElement extends VueElementBase<
   }
 
   protected _unmount(): void {
-    if (__TEST__) {
-      try {
-        this._app!.unmount()
-      } catch (error) {
-        // In test environment, ignore errors caused by accessing Node
-        // after the test environment has been torn down
-        if (
-          error instanceof ReferenceError &&
-          error.message.includes('Node is not defined')
-        ) {
-          // Ignore this error in tests
-        } else {
-          throw error
-        }
-      }
-    } else {
-      this._app!.unmount()
+    if (this._app) {
+      this._app.unmount()
     }
     if (this._instance && this._instance.ce) {
       this._instance.ce = undefined