DOMException.cpp 1012 B

123456789101112131415161718192021222324252627282930313233343536373839
  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_DEFINE_ALLOCATOR(DOMException);
  10. JS::NonnullGCPtr<DOMException> DOMException::create(JS::Realm& realm, FlyString const& name, FlyString const& message)
  11. {
  12. return realm.heap().allocate<DOMException>(realm, realm, name, message);
  13. }
  14. JS::NonnullGCPtr<DOMException> DOMException::construct_impl(JS::Realm& realm, FlyString const& message, FlyString const& name)
  15. {
  16. return realm.heap().allocate<DOMException>(realm, realm, name, message);
  17. }
  18. DOMException::DOMException(JS::Realm& realm, FlyString const& name, FlyString const& message)
  19. : PlatformObject(realm)
  20. , m_name(name)
  21. , m_message(message)
  22. {
  23. }
  24. DOMException::~DOMException() = default;
  25. void DOMException::initialize(JS::Realm& realm)
  26. {
  27. Base::initialize(realm);
  28. WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMException);
  29. }
  30. }