mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
28 lines
616 B
C++
28 lines
616 B
C++
![]() |
/*
|
||
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||
|
*
|
||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
*/
|
||
|
|
||
|
#include <LibJS/Runtime/Iterator.h>
|
||
|
|
||
|
namespace JS {
|
||
|
|
||
|
ThrowCompletionOr<NonnullGCPtr<Iterator>> Iterator::create(Realm& realm, Object& prototype, IteratorRecord iterated)
|
||
|
{
|
||
|
return MUST_OR_THROW_OOM(realm.heap().allocate<Iterator>(realm, prototype, move(iterated)));
|
||
|
}
|
||
|
|
||
|
Iterator::Iterator(Object& prototype, IteratorRecord iterated)
|
||
|
: Object(ConstructWithPrototypeTag::Tag, prototype)
|
||
|
, m_iterated(move(iterated))
|
||
|
{
|
||
|
}
|
||
|
|
||
|
Iterator::Iterator(Object& prototype)
|
||
|
: Iterator(prototype, {})
|
||
|
{
|
||
|
}
|
||
|
|
||
|
}
|