mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: Add define_direct_property and remove the define_property helper
This removes all usages of the non-standard define_property helper method and replaces all it's usages with the specification required alternative or with define_direct_property where appropriate.
This commit is contained in:
committed by
Linus Groh
parent
e915155ca4
commit
a6b8291a9b
@@ -37,7 +37,7 @@ void ProxyConstructor::initialize(GlobalObject& global_object)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
NativeFunction::initialize(global_object);
|
||||
define_property(vm.names.length, Value(2), Attribute::Configurable);
|
||||
define_direct_property(vm.names.length, Value(2), Attribute::Configurable);
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.revocable, revocable, 2, attr);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ JS_DEFINE_NATIVE_FUNCTION(ProxyConstructor::revocable)
|
||||
proxy.revoke();
|
||||
return js_undefined();
|
||||
});
|
||||
revoker->define_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
revoker->define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
|
||||
auto* result = Object::create(global_object, global_object.object_prototype());
|
||||
result->create_data_property_or_throw(vm.names.proxy, proxy);
|
||||
|
||||
Reference in New Issue
Block a user