Issue #2676 - Implement AbortSignal.abort()

This commit is contained in:
Moonchild 2025-01-16 18:34:03 +01:00 committed by roytam1
commit 9fa4b6fd5d
3 changed files with 9 additions and 2 deletions

View file

@ -43,6 +43,12 @@ AbortSignal::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
return AbortSignalBinding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<AbortSignal> AbortSignal::Abort(GlobalObject& aGlobal) {
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<AbortSignal> abortSignal = new AbortSignal(global, true);
return abortSignal.forget();
}
bool
AbortSignal::Aborted() const
{