WeakRefPrototype.h 619 B

12345678910111213141516171819202122232425262728
  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/Runtime/PrototypeObject.h>
  8. #include <LibJS/Runtime/WeakRef.h>
  9. namespace JS {
  10. class WeakRefPrototype final : public PrototypeObject<WeakRefPrototype, WeakRef> {
  11. JS_PROTOTYPE_OBJECT(WeakRefPrototype, WeakRef, WeakRef);
  12. GC_DECLARE_ALLOCATOR(WeakRefPrototype);
  13. public:
  14. virtual void initialize(Realm&) override;
  15. virtual ~WeakRefPrototype() override = default;
  16. private:
  17. explicit WeakRefPrototype(Realm&);
  18. JS_DECLARE_NATIVE_FUNCTION(deref);
  19. };
  20. }