diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/html.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/util/html.js b/src/util/html.js index 2468b8db..b49cce03 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -193,7 +193,11 @@ export class Tag { } clone() { - return new Tag(this.tagName, this.attributes, this.content); + return Reflect.construct(this.constructor, [ + this.tagName, + this.attributes, + this.content, + ]); } set tagName(value) { @@ -507,8 +511,12 @@ export class Template { } clone() { - const clone = new Template(this.#description); + const clone = Reflect.construct(this.constructor, [ + this.#description, + ]); + clone.setSlots(this.#slotValues); + return clone; } |