mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-01 07:35:02 +03:00
GMLCompiler: Force main class name to be resolved from global namespace
Calculator would otherwise trip over this, since there's a class with the same name within the namespace.
This commit is contained in:
parent
842a5adfdc
commit
285119bc1a
Notes:
sideshowbarker
2024-07-17 01:12:07 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/285119bc1a Pull-request: https://github.com/SerenityOS/serenity/pull/20523 Reviewed-by: https://github.com/ADKaster
@ -123,7 +123,7 @@ static char const function_start[] = R"~~~(
|
||||
// This function was auto-generated by the GML compiler.
|
||||
ErrorOr<NonnullRefPtr<@main_class_name@>> @main_class_name@::try_create()
|
||||
{
|
||||
RefPtr<@main_class_name@> main_object;
|
||||
RefPtr<::@main_class_name@> main_object;
|
||||
|
||||
)~~~";
|
||||
|
||||
@ -254,7 +254,7 @@ static ErrorOr<void> generate_loader_for_object(GUI::GML::Object const& gml_obje
|
||||
if (use_object_constructor == UseObjectConstructor::Yes)
|
||||
TRY(append(generator, "@object_name@ = TRY(@class_name@::try_create());"));
|
||||
else
|
||||
TRY(append(generator, "@object_name@ = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) @class_name@()));"));
|
||||
TRY(append(generator, "@object_name@ = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ::@class_name@()));"));
|
||||
|
||||
// Properties
|
||||
TRY(gml_object.try_for_each_property([&](StringView key, NonnullRefPtr<GUI::GML::JsonValueNode> value) -> ErrorOr<void> {
|
||||
|
Loading…
Reference in New Issue
Block a user