diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-09-13 16:01:31 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-13 22:01:31 +0000 |
commit | 81d50e1b6685a12a4f43693e695073a97f79264b (patch) | |
tree | 9a9be134f1f37b11c8521bd1ff7a07d330b6f1a5 /runtime/ops/process.rs | |
parent | 12a75e3b4328dd36a63799262b2e252f9fb9d58e (diff) |
chore: bump deno_core and cargo update (#20480)
Bump deno_core, pulling in new rusty_v8. Requires some op2/deprecation
fixes.
Diffstat (limited to 'runtime/ops/process.rs')
-rw-r--r-- | runtime/ops/process.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index cef4f77f8..a5150950e 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -5,7 +5,6 @@ use crate::permissions::PermissionsContainer; use deno_core::anyhow::Context; use deno_core::error::type_error; use deno_core::error::AnyError; -use deno_core::op; use deno_core::op2; use deno_core::serde_json; use deno_core::AsyncMutFuture; @@ -334,23 +333,21 @@ fn op_spawn_child( spawn_child(state, command) } -// TODO(bartlomieju): op2 doesn't support clippy allows -#[op] +#[op2(async)] #[allow(clippy::await_holding_refcell_ref)] +#[serde] async fn op_spawn_wait( state: Rc<RefCell<OpState>>, - rid: ResourceId, + #[smi] rid: ResourceId, ) -> Result<ChildStatus, AnyError> { let resource = state .borrow_mut() .resource_table .get::<ChildResource>(rid)?; let result = resource.0.try_borrow_mut()?.wait().await?.try_into(); - state - .borrow_mut() - .resource_table - .close(rid) - .expect("shouldn't have closed until now"); + if let Ok(resource) = state.borrow_mut().resource_table.take_any(rid) { + resource.close(); + } result } |