mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
LibWeb/Bindings: Define constructor properties in the correct order
This commit is contained in:
parent
3261f873c5
commit
627b7dd936
Notes:
github-actions[bot]
2025-01-11 01:44:32 +00:00
Author: https://github.com/shannonbooth
Commit: 627b7dd936
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3222
Reviewed-by: https://github.com/tcl3 ✅
8 changed files with 56 additions and 9 deletions
|
@ -152,7 +152,6 @@ void Intrinsics::create_web_prototype_and_constructor<@prototype_class@>(JS::Rea
|
|||
m_constructors.set("@interface_name@"_fly_string, constructor);
|
||||
|
||||
prototype->define_direct_property(vm.names.constructor, constructor.ptr(), JS::Attribute::Writable | JS::Attribute::Configurable);
|
||||
constructor->define_direct_property(vm.names.name, JS::PrimitiveString::create(vm, "@interface_name@"_string), JS::Attribute::Configurable);
|
||||
)~~~");
|
||||
|
||||
if (legacy_constructor.has_value()) {
|
||||
|
@ -160,9 +159,7 @@ void Intrinsics::create_web_prototype_and_constructor<@prototype_class@>(JS::Rea
|
|||
gen.set("legacy_constructor_class", legacy_constructor->constructor_class);
|
||||
gen.append(R"~~~(
|
||||
auto legacy_constructor = realm.create<@legacy_constructor_class@>(realm);
|
||||
m_constructors.set("@legacy_interface_name@"_fly_string, legacy_constructor);
|
||||
|
||||
legacy_constructor->define_direct_property(vm.names.name, JS::PrimitiveString::create(vm, "@legacy_interface_name@"_string), JS::Attribute::Configurable);)~~~");
|
||||
m_constructors.set("@legacy_interface_name@"_fly_string, legacy_constructor);)~~~");
|
||||
}
|
||||
|
||||
gen.append(R"~~~(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue