diff --git a/components/script/dom/abortsignal.rs b/components/script/dom/abortsignal.rs index c714b6d7b69..0b1198d33ac 100644 --- a/components/script/dom/abortsignal.rs +++ b/components/script/dom/abortsignal.rs @@ -115,13 +115,19 @@ impl AbortSignal { self.upcast::() .fire_event(atom!("abort"), can_gc); } + + /// + fn aborted(&self) -> bool { + // An AbortSignal object is aborted when its abort reason is not undefined. + !self.abort_reason.get().is_undefined() + } } impl AbortSignalMethods for AbortSignal { /// fn Aborted(&self) -> bool { - // TODO - false + // The aborted getter steps are to return true if this is aborted; otherwise false. + self.aborted() } ///