From ddc018fb757e59f09adac88fc6f98e2c6425c4af Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 5 Sep 2022 12:17:41 +0200 Subject: [PATCH] LibWeb: Use fully qualified type names in the IDL generator more There are still some remaining cases where generated code depends on the existence of FooWrapper => Web::NS::Foo mappings. Fixing those will require figuring out the appropriate namespace for all IDL types, not just the currently parsed interface. --- .../LibWeb/WrapperGenerator/IDLGenerators.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp index 5413b598e6..40684cff88 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp @@ -2494,10 +2494,10 @@ static JS::ThrowCompletionOr<@fully_qualified_name@*> impl_from(JS::VM& vm) } generator.append(R"~~~( - if (!is<@wrapper_class@>(this_object)) + if (!is<@fully_qualified_name@>(this_object)) return vm.throw_completion(JS::ErrorType::NotAnObjectOfType, "@fully_qualified_name@"); - return &static_cast<@wrapper_class@*>(this_object)->impl(); + return &static_cast<@fully_qualified_name@*>(this_object)->impl(); } )~~~"); } @@ -2789,9 +2789,9 @@ void @prototype_class@::initialize(JS::Realm& realm) static JS::ThrowCompletionOr<@fully_qualified_name@*> impl_from(JS::VM& vm) { auto* this_object = TRY(vm.this_value().to_object(vm)); - if (!is<@wrapper_class@>(this_object)) + if (!is<@fully_qualified_name@>(this_object)) return vm.throw_completion(JS::ErrorType::NotAnObjectOfType, "@fully_qualified_name@"); - return &static_cast<@wrapper_class@*>(this_object)->impl(); + return &static_cast<@fully_qualified_name@*>(this_object)->impl(); } JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::next)