DOMException.cpp 920 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/WebIDL/DOMException.h>
  8. namespace Web::WebIDL {
  9. JS::NonnullGCPtr<DOMException> DOMException::create(JS::Realm& realm, FlyString const& name, FlyString const& message)
  10. {
  11. return *realm.heap().allocate<DOMException>(realm, realm, name, message);
  12. }
  13. JS::NonnullGCPtr<DOMException> DOMException::construct_impl(JS::Realm& realm, FlyString const& message, FlyString const& name)
  14. {
  15. return *realm.heap().allocate<DOMException>(realm, realm, name, message);
  16. }
  17. DOMException::DOMException(JS::Realm& realm, FlyString const& name, FlyString const& message)
  18. : PlatformObject(realm)
  19. , m_name(name)
  20. , m_message(message)
  21. {
  22. set_prototype(&Bindings::cached_web_prototype(realm, "DOMException"));
  23. }
  24. DOMException::~DOMException() = default;
  25. }