From 75e084e8e0f7585a0cd0c30f7462298faf927103 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Fri, 19 Apr 2019 19:08:25 +0800 Subject: [PATCH 1/3] Add generic support to `Element.closest()` --- inputfiles/addedTypes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": { From 5d44054491e7443dca6fea2abe4c27915294e6cb Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sat, 20 Apr 2019 09:53:08 +0800 Subject: [PATCH 2/3] Update widlprocess.ts https://github.com/Microsoft/TSJS-lib-generator/pull/696#issuecomment-485049403 --- src/widlprocess.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 8827410230dfb4693a9ce89ca4027c70fd748140 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sat, 20 Apr 2019 09:53:21 +0800 Subject: [PATCH 3/3] Add generated files --- baselines/dom.generated.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. */