diff --git a/Userland/Libraries/LibIDL/IDLParser.cpp b/Userland/Libraries/LibIDL/IDLParser.cpp index 240da5ff3c..22a06bd528 100644 --- a/Userland/Libraries/LibIDL/IDLParser.cpp +++ b/Userland/Libraries/LibIDL/IDLParser.cpp @@ -366,7 +366,7 @@ Function Parser::parse_function(HashMap& ext return function; } -void Parser::parse_constructor(Interface& interface) +void Parser::parse_constructor(HashMap& extended_attributes, Interface& interface) { assert_string("constructor"sv); consume_whitespace(); @@ -376,7 +376,7 @@ void Parser::parse_constructor(Interface& interface) consume_whitespace(); assert_specific(';'); - interface.constructors.append(Constructor { interface.name, move(parameters) }); + interface.constructors.append(Constructor { interface.name, move(parameters), move(extended_attributes) }); } void Parser::parse_stringifier(HashMap& extended_attributes, Interface& interface) @@ -551,7 +551,7 @@ void Parser::parse_interface(Interface& interface) } if (lexer.next_is("constructor")) { - parse_constructor(interface); + parse_constructor(extended_attributes, interface); continue; } diff --git a/Userland/Libraries/LibIDL/IDLParser.h b/Userland/Libraries/LibIDL/IDLParser.h index 2acd5fd897..32b0cf9e85 100644 --- a/Userland/Libraries/LibIDL/IDLParser.h +++ b/Userland/Libraries/LibIDL/IDLParser.h @@ -47,7 +47,7 @@ private: void parse_interface_mixin(Interface&); void parse_dictionary(Interface&); void parse_callback_function(HashMap& extended_attributes, Interface&); - void parse_constructor(Interface&); + void parse_constructor(HashMap& extended_attributes, Interface&); void parse_getter(HashMap& extended_attributes, Interface&); void parse_setter(HashMap& extended_attributes, Interface&); void parse_deleter(HashMap& extended_attributes, Interface&); diff --git a/Userland/Libraries/LibIDL/Types.h b/Userland/Libraries/LibIDL/Types.h index a471fb0aca..e76f21e30e 100644 --- a/Userland/Libraries/LibIDL/Types.h +++ b/Userland/Libraries/LibIDL/Types.h @@ -164,6 +164,7 @@ struct Function { struct Constructor { DeprecatedString name; Vector parameters; + HashMap extended_attributes; size_t shortest_length() const { return get_function_shortest_length(*this); } };