diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index a689cbbd5..0725072c8 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -5018,7 +5018,7 @@ interface Element extends Node, ParentNode, NonDocumentTypeChildNode, ChildNode, */ closest(selector: K): HTMLElementTagNameMap[K] | null; closest(selector: K): SVGElementTagNameMap[K] | null; - closest(selector: string): Element | null; + closest(selector: string): E | null; /** * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. */ diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index 62ce7ab52..ca2487ca8 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -722,7 +722,7 @@ "override-signatures": [ "closest(selector: K): HTMLElementTagNameMap[K] | null", "closest(selector: K): SVGElementTagNameMap[K] | null", - "closest(selector: string): Element | null" + "closest(selector: string): E | null" ] }, "insertAdjacentElement": { diff --git a/src/widlprocess.ts b/src/widlprocess.ts index 2f7b7f3f7..dda75c7af 100644 --- a/src/widlprocess.ts +++ b/src/widlprocess.ts @@ -197,7 +197,7 @@ function convertOperation(operation: webidl2.OperationMemberType, inheritedExpos throw new Error("Unexpected anonymous operation"); } return { - name: operation.name, + name: operation.name || undefined, signature: [{ ...convertIdlType(operation.idlType), param: operation.arguments.map(convertArgument)