dom: implement abort signal reason method (#37227)

Implement the `reason` method of `AbortSignal`; part of
https://github.com/servo/servo/issues/36935.

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
Gregory Terzian 2025-06-03 17:35:51 +08:00 committed by GitHub
parent ad95a74389
commit b4035cc88e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -131,8 +131,9 @@ impl AbortSignalMethods<crate::DomTypeHolder> for AbortSignal {
}
/// <https://dom.spec.whatwg.org/#dom-abortsignal-reason>
fn Reason(&self, _: JSContext, _rval: MutableHandleValue) {
// TODO
fn Reason(&self, _cx: JSContext, mut rval: MutableHandleValue) {
// The reason getter steps are to return thiss abort reason.
rval.set(self.abort_reason.get());
}
/// <https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted>