Skip to content

Commit 61070d8

Browse files
committed
multiple <constructor> directly
1 parent a2420dd commit 61070d8

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

TS.fsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -1090,13 +1090,10 @@ module Emit =
10901090
| Some c' -> emitConstructorSigFromJson c'
10911091
| _ ->
10921092
//Emit constructor signature
1093-
match i.Constructors with
1094-
| Some ctors ->
1095-
i.Constructors.Value.Constructors |> Array.iter emitConstructorSingleSignature
1096-
| _ ->
1097-
match i.Constructor with
1098-
| Some ctor -> emitConstructorSingleSignature ctor
1099-
| _ -> Pt.Printl "new(): %s;" i.Name
1093+
if not (Array.isEmpty i.Constructors) then
1094+
i.Constructors |> Array.iter emitConstructorSingleSignature
1095+
else
1096+
Pt.Printl "new(): %s;" i.Name
11001097

11011098
getAddedItems ItemKind.Constructor Flavor.All
11021099
|> Array.filter (matchInterface i.Name)

sample.xml

+9-11
Original file line numberDiff line numberDiff line change
@@ -6275,17 +6275,15 @@
62756275
</methods>
62766276
</interface>
62776277
<interface name="ImageData" extends="Object">
6278-
<constructors>
6279-
<constructor>
6280-
<param name="sw" type="unsigned long"/>
6281-
<param name="sh" type="unsigned long"/>
6282-
</constructor>
6283-
<constructor>
6284-
<param name="data" type="Uint8ClampedArray"/>
6285-
<param name="sw" type="unsigned long"/>
6286-
<param name="sh" optional="1" type="unsigned long"/>
6287-
</constructor>
6288-
</constructors>
6278+
<constructor>
6279+
<param name="sw" type="unsigned long"/>
6280+
<param name="sh" type="unsigned long"/>
6281+
</constructor>
6282+
<constructor>
6283+
<param name="data" type="Uint8ClampedArray"/>
6284+
<param name="sw" type="unsigned long"/>
6285+
<param name="sh" optional="1" type="unsigned long"/>
6286+
</constructor>
62896287
<properties>
62906288
<property name="width" read-only="1" type="unsigned long"/>
62916289
<property name="height" read-only="1" type="unsigned long"/>

0 commit comments

Comments
 (0)