From f4c8f2102f86da4ee798439fa156a5039a5f92f6 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 20 Oct 2021 14:47:14 -0400 Subject: [PATCH] LibJS: Retrieve GetIterator's optional 'method' function using GetMethod This is in alignment with the spec. --- Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp | 5 +++-- 1 file 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 #include +#include #include #include @@ -18,8 +19,8 @@ ThrowCompletionOr 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())