mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
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.
This commit is contained in:
parent
8f110e0fb1
commit
ddc018fb75
Notes:
sideshowbarker
2024-07-17 07:23:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ddc018fb75 Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue