/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace Web::DOM { JS::NonnullGCPtr DOMException::create(JS::Object& global_object, FlyString const& name, FlyString const& message) { auto& window = verify_cast(global_object); return *window.heap().allocate(window.realm(), window, name, message); } JS::NonnullGCPtr DOMException::create_with_global_object(JS::Object& global_object, FlyString const& message, FlyString const& name) { auto& window = verify_cast(global_object); return *window.heap().allocate(window.realm(), window, name, message); } DOMException::DOMException(HTML::Window& window, FlyString const& name, FlyString const& message) : PlatformObject(window.realm()) , m_name(name) , m_message(message) { set_prototype(&window.cached_web_prototype("DOMException")); } DOMException::~DOMException() = default; }