summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-10-20 14:47:14 -0400
committerLinus Groh <mail@linusgroh.de>2021-10-21 00:26:45 +0100
commitf4c8f2102f86da4ee798439fa156a5039a5f92f6 (patch)
treefd6fcdaf98b1d388e2d342107144442fe1cd53c6 /Userland/Libraries/LibJS/Runtime
parent860a37640b24e425da34c086d57fa938595d97f7 (diff)
downloadserenity-f4c8f2102f86da4ee798439fa156a5039a5f92f6.zip
LibJS: Retrieve GetIterator's optional 'method' function using GetMethod
This is in alignment with the spec.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r--Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp b/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp
index 513a0121e0..c465b550ee 100644
--- a/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp
+++ b/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp
@@ -6,6 +6,7 @@
#include <LibJS/Runtime/AbstractOperations.h>
#include <LibJS/Runtime/Error.h>
+#include <LibJS/Runtime/FunctionObject.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/IteratorOperations.h>
@@ -18,8 +19,8 @@ ThrowCompletionOr<Object*> get_iterator(GlobalObject& global_object, Value value
if (method.is_empty()) {
if (hint == IteratorHint::Async)
TODO();
- auto object = TRY(value.to_object(global_object));
- method = TRY(object->get(*vm.well_known_symbol_iterator()));
+
+ method = TRY(value.get_method(global_object, *vm.well_known_symbol_iterator()));
}
if (!method.is_function())