2023-06-24 14:01:04 +00: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 {
|
|
|
|
|
|
|
|
class IteratorConstructor : public NativeFunction {
|
|
|
|
JS_OBJECT(IteratorConstructor, NativeFunction);
|
2024-11-14 15:01:23 +00:00
|
|
|
GC_DECLARE_ALLOCATOR(IteratorConstructor);
|
2023-06-24 14:01:04 +00:00
|
|
|
|
|
|
|
public:
|
2023-08-07 06:41:28 +00:00
|
|
|
virtual void initialize(Realm&) override;
|
2023-06-24 14:01:04 +00:00
|
|
|
|
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
2024-11-14 15:01:23 +00:00
|
|
|
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
|
2023-06-24 14:01:04 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
explicit IteratorConstructor(Realm&);
|
|
|
|
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
2023-06-24 15:27:30 +00:00
|
|
|
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(from);
|
2023-06-24 14:01:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|