IteratorConstructor.h 738 B

1234567891011121314151617181920212223242526272829303132
  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. JS_DECLARE_ALLOCATOR(IteratorConstructor);
  13. public:
  14. virtual void initialize(Realm&) override;
  15. virtual ThrowCompletionOr<Value> call() override;
  16. virtual ThrowCompletionOr<NonnullGCPtr<Object>> construct(FunctionObject& new_target) override;
  17. private:
  18. explicit IteratorConstructor(Realm&);
  19. virtual bool has_constructor() const override { return true; }
  20. JS_DECLARE_NATIVE_FUNCTION(from);
  21. };
  22. }