IteratorConstructor.h 691 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Forward.h>
  8. #include <LibJS/Runtime/NativeFunction.h>
  9. namespace JS {
  10. class IteratorConstructor : public NativeFunction {
  11. JS_OBJECT(IteratorConstructor, NativeFunction);
  12. public:
  13. virtual void initialize(Realm&) override;
  14. virtual ThrowCompletionOr<Value> call() override;
  15. virtual ThrowCompletionOr<NonnullGCPtr<Object>> construct(FunctionObject& new_target) override;
  16. private:
  17. explicit IteratorConstructor(Realm&);
  18. virtual bool has_constructor() const override { return true; }
  19. JS_DECLARE_NATIVE_FUNCTION(from);
  20. };
  21. }