MediaError.cpp 679 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Runtime/Realm.h>
  7. #include <LibWeb/Bindings/Intrinsics.h>
  8. #include <LibWeb/Bindings/MediaErrorPrototype.h>
  9. #include <LibWeb/HTML/MediaError.h>
  10. namespace Web::HTML {
  11. MediaError::MediaError(JS::Realm& realm, Code code, String message)
  12. : Base(realm)
  13. , m_code(code)
  14. , m_message(move(message))
  15. {
  16. }
  17. JS::ThrowCompletionOr<void> MediaError::initialize(JS::Realm& realm)
  18. {
  19. MUST_OR_THROW_OOM(Base::initialize(realm));
  20. set_prototype(&Bindings::ensure_web_prototype<Bindings::MediaErrorPrototype>(realm, "MediaError"));
  21. return {};
  22. }
  23. }