2023-06-24 10:01:04 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibJS/Forward.h>
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
2025-06-28 21:39:13 -07:00
|
|
|
class JS_API IteratorConstructor : public NativeFunction {
|
2023-06-24 10:01:04 -04:00
|
|
|
JS_OBJECT(IteratorConstructor, NativeFunction);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(IteratorConstructor);
|
2023-06-24 10:01:04 -04:00
|
|
|
|
|
|
|
public:
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(Realm&) override;
|
2023-06-24 10:01:04 -04:00
|
|
|
|
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
2024-11-15 04:01:23 +13:00
|
|
|
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
|
2023-06-24 10:01:04 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
explicit IteratorConstructor(Realm&);
|
|
|
|
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
2023-06-24 11:27:30 -04:00
|
|
|
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(from);
|
2023-06-24 10:01:04 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|