mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 20:15:00 +00:00
LibJS/Bytecode: Move object_to_iterator to CommonImplementations
This commit is contained in:
parent
4f8f8b7792
commit
661dbbc83d
3 changed files with 10 additions and 9 deletions
|
@ -535,4 +535,13 @@ Object* iterator_to_object(VM& vm, IteratorRecord iterator)
|
|||
return object;
|
||||
}
|
||||
|
||||
IteratorRecord object_to_iterator(VM& vm, Object& object)
|
||||
{
|
||||
return IteratorRecord {
|
||||
.iterator = &MUST(object.get(vm.names.iterator)).as_object(),
|
||||
.next_method = MUST(object.get(vm.names.next)),
|
||||
.done = MUST(object.get(vm.names.done)).as_bool()
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue