mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
LibJS: Retrieve GetIterator's optional 'method' function using GetMethod
This is in alignment with the spec.
This commit is contained in:
parent
860a37640b
commit
f4c8f2102f
1 changed files with 3 additions and 2 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue