From 093b3eee58181ec45839d0fe10b8157326a102b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 25 Oct 2023 13:43:38 +0200 Subject: chore: update deno_core and port all remaining ops to `op2` (#20954) Signed-off-by: Matt Mastracci Co-authored-by: Matt Mastracci --- ext/node/ops/http2.rs | 6 +++--- ext/node/ops/v8.rs | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'ext/node/ops') diff --git a/ext/node/ops/http2.rs b/ext/node/ops/http2.rs index e0dfa1396..676ef7e6e 100644 --- a/ext/node/ops/http2.rs +++ b/ext/node/ops/http2.rs @@ -9,7 +9,6 @@ use std::task::Poll; use bytes::Bytes; use deno_core::error::AnyError; use deno_core::futures::future::poll_fn; -use deno_core::op; use deno_core::op2; use deno_core::serde::Serialize; use deno_core::AsyncRefCell; @@ -157,10 +156,11 @@ pub async fn op_http2_listen( ) } -#[op] +#[op2(async)] +#[serde] pub async fn op_http2_accept( state: Rc>, - rid: ResourceId, + #[smi] rid: ResourceId, ) -> Result< Option<(Vec<(ByteString, ByteString)>, ResourceId, ResourceId)>, AnyError, diff --git a/ext/node/ops/v8.rs b/ext/node/ops/v8.rs index fdfc559d7..dbb84e932 100644 --- a/ext/node/ops/v8.rs +++ b/ext/node/ops/v8.rs @@ -1,5 +1,4 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -use deno_core::op; use deno_core::op2; use deno_core::v8; @@ -8,8 +7,11 @@ pub fn op_v8_cached_data_version_tag() -> u32 { v8::script_compiler::cached_data_version_tag() } -#[op(v8)] -fn op_v8_get_heap_statistics(scope: &mut v8::HandleScope, buffer: &mut [f64]) { +#[op2] +pub fn op_v8_get_heap_statistics( + scope: &mut v8::HandleScope, + #[buffer] buffer: &mut [f64], +) { let mut stats = v8::HeapStatistics::default(); scope.get_heap_statistics(&mut stats); -- cgit v1.2.3