mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
fix
This commit is contained in:
parent
c84d7c0c62
commit
08bbcb065b
1 changed files with 12 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue