mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
parent
64040c136e
commit
1a5bf15b4d
3 changed files with 19 additions and 0 deletions
|
@ -73,6 +73,22 @@ HTML::EventHandler AbortSignal::onabort()
|
|||
return event_handler_attribute(HTML::EventNames::abort);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted
|
||||
JS::ThrowCompletionOr<void> AbortSignal::throw_if_aborted() const
|
||||
{
|
||||
auto& global_object = wrapper()->global_object();
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
// The throwIfAborted() method steps are to throw this’s abort reason, if this is aborted.
|
||||
if (!aborted())
|
||||
return {};
|
||||
|
||||
// FIXME: Remove this once VM::exception() has been removed.
|
||||
vm.throw_exception(global_object, m_abort_reason);
|
||||
|
||||
return JS::throw_completion(m_abort_reason);
|
||||
}
|
||||
|
||||
void AbortSignal::visit_edges(JS::Cell::Visitor& visitor)
|
||||
{
|
||||
visitor.visit(m_abort_reason);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue