mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibJS: Store the %Array.prototype.values% intrinsic on the global object
Also group the getter functions for all the additional intrinsics (not generated via macros), and initialize the members.
This commit is contained in:
parent
50472fd69f
commit
1c1354db07
Notes:
sideshowbarker
2024-07-18 08:20:36 +09:00
Author: https://github.com/linusg
Commit: 1c1354db07
Pull-request: https://github.com/SerenityOS/serenity/pull/9013
Reviewed-by: https://github.com/IdanHo ✅
3 changed files with 15 additions and 18 deletions
|
@ -435,10 +435,7 @@ Object* create_unmapped_arguments_object(GlobalObject& global_object, Vector<Val
|
|||
}
|
||||
|
||||
// 7. Perform ! DefinePropertyOrThrow(obj, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }).
|
||||
// FIXME: This is not guaranteed to be %Array.prototype.values%!
|
||||
auto array_prototype_values = global_object.array_prototype()->get(vm.names.values);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto* array_prototype_values = global_object.array_prototype_values_function();
|
||||
object->define_property_or_throw(*vm.well_known_symbol_iterator(), { .value = array_prototype_values, .writable = true, .enumerable = false, .configurable = true });
|
||||
VERIFY(!vm.exception());
|
||||
|
||||
|
@ -530,10 +527,7 @@ Object* create_mapped_arguments_object(GlobalObject& global_object, FunctionObje
|
|||
}
|
||||
|
||||
// 20. Perform ! DefinePropertyOrThrow(obj, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }).
|
||||
// FIXME: This is not guaranteed to be %Array.prototype.values%!
|
||||
auto array_prototype_values = global_object.array_prototype()->get(vm.names.values);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto* array_prototype_values = global_object.array_prototype_values_function();
|
||||
object->define_property_or_throw(*vm.well_known_symbol_iterator(), { .value = array_prototype_values, .writable = true, .enumerable = false, .configurable = true });
|
||||
VERIFY(!vm.exception());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue