summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-07-25 19:37:42 +0100
committerLinus Groh <mail@linusgroh.de>2021-07-25 23:44:36 +0100
commit1c1354db07cbc371475fb8a1d1adfe6ead89b189 (patch)
tree40d6e19fe6ed484485489c3db4917f5455e22d87 /Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
parent50472fd69f7fb6faee017c401513c7f6331f0c66 (diff)
downloadserenity-1c1354db07cbc371475fb8a1d1adfe6ead89b189.zip
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
index b792abd799..4d384eb276 100644
--- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
+++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
@@ -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());