/* * Copyright (c) 2023, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #include namespace JS { ThrowCompletionOr> Iterator::create(Realm& realm, Object& prototype, IteratorRecord iterated) { return MUST_OR_THROW_OOM(realm.heap().allocate(realm, prototype, move(iterated))); } Iterator::Iterator(Object& prototype, IteratorRecord iterated) : Object(ConstructWithPrototypeTag::Tag, prototype) , m_iterated(move(iterated)) { } Iterator::Iterator(Object& prototype) : Iterator(prototype, {}) { } }