Skip to content

Commit

Permalink
safely extend DocumentFragment if available
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed May 10, 2023
1 parent 5c3e242 commit 3fef8ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/template-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function* collectParts(el: DocumentFragment): Generator<TemplatePart> {

const processors = new WeakMap<TemplateInstance, TemplateTypeInit>()
const parts = new WeakMap<TemplateInstance, Iterable<TemplatePart>>()
export class TemplateInstance extends DocumentFragment {
export class TemplateInstance extends (globalThis.DocumentFragment || EventTarget) {
constructor(template: HTMLTemplateElement, params: unknown, processor: TemplateTypeInit = propertyIdentity) {
super()
// This is to fix an inconsistency in Safari which prevents us from
Expand Down

0 comments on commit 3fef8ca

Please sign in to comment.