mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
LibJS/Bytecode: Move object_to_iterator to CommonImplementations
This commit is contained in:
committed by
Andreas Kling
parent
4f8f8b7792
commit
661dbbc83d
Notes:
sideshowbarker
2024-07-16 22:51:10 +09:00
Author: https://github.com/skyrising Commit: https://github.com/SerenityOS/serenity/commit/661dbbc83d Pull-request: https://github.com/SerenityOS/serenity/pull/21677
@@ -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()
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user