mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
IDLGenerators: Correctly treat optional enums as optional
Specifically, this makes enums in dictionaries not cause compile errors.
This commit is contained in:
parent
e174215845
commit
ffb236adbd
|
|
@ -2067,7 +2067,7 @@ static void generate_wrap_statement(SourceGenerator& generator, ByteString const
|
|||
)~~~");
|
||||
} else if (interface.enumerations.contains(type.name())) {
|
||||
// Handle Enum? values, which were null-checked above
|
||||
if (type.is_nullable())
|
||||
if (type.is_nullable() || is_optional)
|
||||
scoped_generator.set("value", ByteString::formatted("{}.value()", value));
|
||||
scoped_generator.append(R"~~~(
|
||||
@result_expression@ JS::PrimitiveString::create(vm, Bindings::idl_enum_to_string(@value@));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user