1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]

This is where the fun begins. :^)
This commit is contained in:
Linus Groh 2022-08-21 14:00:56 +01:00
parent f6c4a0f5d0
commit a022e548b8
129 changed files with 1230 additions and 1325 deletions

View file

@ -99,7 +99,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::define_property)
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_string_without_side_effects());
// 2. Let key be ? ToPropertyKey(propertyKey).
auto key = TRY(property_key.to_property_key(global_object));
auto key = TRY(property_key.to_property_key(vm));
// 3. Let desc be ? ToPropertyDescriptor(attributes).
auto descriptor = TRY(to_property_descriptor(global_object, attributes));
@ -119,7 +119,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::delete_property)
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_string_without_side_effects());
// 2. Let key be ? ToPropertyKey(propertyKey).
auto key = TRY(property_key.to_property_key(global_object));
auto key = TRY(property_key.to_property_key(vm));
// 3. Return ? target.[[Delete]](key).
return Value(TRY(target.as_object().internal_delete(key)));
@ -137,7 +137,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::get)
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_string_without_side_effects());
// 2. Let key be ? ToPropertyKey(propertyKey).
auto key = TRY(property_key.to_property_key(global_object));
auto key = TRY(property_key.to_property_key(vm));
// 3. If receiver is not present, then
if (vm.argument_count() < 3) {
@ -160,7 +160,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::get_own_property_descriptor)
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_string_without_side_effects());
// 2. Let key be ? ToPropertyKey(propertyKey).
auto key = TRY(property_key.to_property_key(global_object));
auto key = TRY(property_key.to_property_key(vm));
// 3. Let desc be ? target.[[GetOwnProperty]](key).
auto descriptor = TRY(target.as_object().internal_get_own_property(key));
@ -193,7 +193,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::has)
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_string_without_side_effects());
// 2. Let key be ? ToPropertyKey(propertyKey).
auto key = TRY(property_key.to_property_key(global_object));
auto key = TRY(property_key.to_property_key(vm));
// 3. Return ? target.[[HasProperty]](key).
return Value(TRY(target.as_object().internal_has_property(key)));
@ -256,7 +256,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::set)
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_string_without_side_effects());
// 2. Let key be ? ToPropertyKey(propertyKey).
auto key = TRY(property_key.to_property_key(global_object));
auto key = TRY(property_key.to_property_key(vm));
// 3. If receiver is not present, then
if (vm.argument_count() < 4) {