From 08bbcb065be2d8f7e49ee5aef214fcc73611a46d Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Thu, 21 Aug 2025 23:00:00 +0900 Subject: [PATCH] fix --- ext/web/event.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ext/web/event.rs b/ext/web/event.rs index c5e404c6e6..e4bc26bcf6 100644 --- a/ext/web/event.rs +++ b/ext/web/event.rs @@ -2137,6 +2137,7 @@ impl AbortSignal { cppgc::wrap_object2(scope, obj, (event_target, abort_signal)) } + #[required(1)] #[static_method] fn any<'a>( scope: &mut v8::HandleScope<'a>, @@ -2168,6 +2169,17 @@ impl AbortSignal { )) } + fn throw_if_aborted<'a>( + &self, + scope: &mut v8::HandleScope<'a>, + ) -> v8::Local<'a, v8::Value> { + if let Some(reason) = &*self.reason.borrow() { + let reason = v8::Local::new(scope, reason); + scope.throw_exception(reason); + } + v8::undefined(scope).into() + } + #[getter] fn aborted(&self) -> bool { self.aborted_inner()