AsyncFunctionConstructor.h 723 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/AST.h>
  8. #include <LibJS/Runtime/NativeFunction.h>
  9. namespace JS {
  10. class AsyncFunctionConstructor final : public NativeFunction {
  11. JS_OBJECT(AsyncFunctionConstructor, NativeFunction);
  12. public:
  13. explicit AsyncFunctionConstructor(Realm&);
  14. virtual void initialize(Realm&) override;
  15. virtual ~AsyncFunctionConstructor() override = default;
  16. virtual ThrowCompletionOr<Value> call() override;
  17. virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
  18. private:
  19. virtual bool has_constructor() const override { return true; }
  20. };
  21. }