Переглянути джерело

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.
Andreas Kling 2 роки тому
батько
коміт
ddc018fb75

+ 4 - 4
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::TypeError>(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::TypeError>(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)