LibWeb/Bindings: Define constructor properties in the correct order

This commit is contained in:
Shannon Booth 2025-01-11 13:40:44 +13:00 committed by Tim Ledbetter
commit 627b7dd936
Notes: github-actions[bot] 2025-01-11 01:44:32 +00:00
8 changed files with 56 additions and 9 deletions

View file

@ -26,8 +26,9 @@ void ImageConstructor::initialize(JS::Realm& realm)
auto& vm = this->vm();
Base::initialize(realm);
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLImageElementPrototype>(realm, "HTMLImageElement"_fly_string), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
define_direct_property(vm.names.name, JS::PrimitiveString::create(vm, "Image"_string), JS::Attribute::Configurable);
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLImageElementPrototype>(realm, "HTMLImageElement"_fly_string), 0);
}
JS::ThrowCompletionOr<JS::Value> ImageConstructor::call()