mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibWeb: Support NoInstanceWrapper extended attribute on interfaces
This tells the wrapper generator that there is no separate wrapper class for this interface, and it should refer directly to the C++ "Foo" object instead of "FooWrapper".
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:29:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4ae2390554 Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
@@ -570,7 +570,11 @@ void Parser::parse_interface(Interface& interface)
|
||||
parse_function(extended_attributes, interface);
|
||||
}
|
||||
|
||||
interface.wrapper_class = String::formatted("{}Wrapper", interface.name);
|
||||
if (interface.extended_attributes.contains("NoInstanceWrapper")) {
|
||||
interface.wrapper_class = interface.name;
|
||||
} else {
|
||||
interface.wrapper_class = String::formatted("{}Wrapper", interface.name);
|
||||
}
|
||||
interface.wrapper_base_class = String::formatted("{}Wrapper", interface.parent_name.is_empty() ? String::empty() : interface.parent_name);
|
||||
interface.constructor_class = String::formatted("{}Constructor", interface.name);
|
||||
interface.prototype_class = String::formatted("{}Prototype", interface.name);
|
||||
|
||||
Reference in New Issue
Block a user