ShadowRealmConstructor.h 701 B

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