[IMP] component: validate mounting target at patch time

This commit is contained in:
Géry Debongnie
2022-01-31 16:57:58 +01:00
committed by Aaron Bohy
parent bd98d4d0d0
commit 50aac42bdc
5 changed files with 47 additions and 10 deletions
+2
View File
@@ -1,4 +1,5 @@
import { BDom, mount } from "../blockdom";
import { validateTarget } from "../utils";
import type { ComponentNode } from "./component_node";
import { fibersInError, handleError } from "./error_handling";
import { STATUS } from "./status";
@@ -158,6 +159,7 @@ export class MountFiber extends RootFiber {
complete() {
let current: Fiber | undefined = this;
try {
validateTarget(this.target);
const node = this.node;
if (node.bdom) {
// this is a complicated situation: if we mount a fiber with an existing