Skip to content

Commit e105830

Browse files
committed
fix on variadic union param type
1 parent eea0ee5 commit e105830

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TS.fsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ module Emit =
719719
| "DOMString" | "USVString" -> "string"
720720
| "DOMTimeStamp" -> "number"
721721
| "EventListener" -> "EventListenerOrEventListenerObject"
722-
| "double" | "float" | "unrestricted float" -> "number"
722+
| "double" | "float" | "unrestricted double" | "unrestricted float" -> "number"
723723
| "Function" -> "Function"
724724
| "FrozenArray" -> "ReadonlyArray"
725725
| "long" | "long long" | "signed long" | "signed long long" | "unsigned long" | "unsigned long long" -> "number"
@@ -869,7 +869,7 @@ module Emit =
869869
(if p.Variadic then "..." else "") +
870870
(AdjustParamName p.Name) +
871871
(if isOptional then "?: " else ": ") +
872-
pType +
872+
(if p.Variadic && pType.Contains(" | ") then "(" + pType + ")" else pType) +
873873
(if p.Variadic then "[]" else "")
874874
String.Join(", ", (List.map paramToString ps))
875875

0 commit comments

Comments
 (0)