Make getAllTypes unwrap IDL record<K, V> types (#37039)

IDL `record` types can themselves contain types that are not described
anywhere else. An example is in
https://github.com/servo/servo/issues/37038, where the `record` contains
a definition of a union. These inner types must be returned from
`getAllTypes`, otherwise we won't generate code for them.

This PR also adds a few type annotations. I can remove them if
requested, but I think they're helpful.

Testing:  Includes a regression test
Fixes: https://github.com/servo/servo/issues/37038

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-05-18 11:30:20 +02:00 committed by GitHub
parent 070a8cf937
commit edea2caec1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 2 deletions

View file

@ -621,3 +621,9 @@ namespace TestNS {
};
typedef Promise<undefined> PromiseUndefined;
// https://github.com/servo/servo/issues/37038
dictionary NotUsedAnyWhereElse {};
dictionary RecordFieldWithUnionInside {
record<USVString, (USVString or NotUsedAnyWhereElse)> recordWithUnionField;
};