PromisePrototype.h 645 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/PrototypeObject.h>
  8. namespace JS {
  9. class PromisePrototype final : public PrototypeObject<PromisePrototype, Promise> {
  10. JS_PROTOTYPE_OBJECT(PromisePrototype, Promise, Promise);
  11. GC_DECLARE_ALLOCATOR(PromisePrototype);
  12. public:
  13. virtual void initialize(Realm&) override;
  14. virtual ~PromisePrototype() override = default;
  15. private:
  16. PromisePrototype(Realm&);
  17. JS_DECLARE_NATIVE_FUNCTION(then);
  18. JS_DECLARE_NATIVE_FUNCTION(catch_);
  19. JS_DECLARE_NATIVE_FUNCTION(finally);
  20. };
  21. }