From 65d9bfb53361bfce6dc594c6a9df92c017dea6cb Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Sat, 24 Jun 2023 13:54:10 +0200 Subject: refactor(ops): Adding op2 macro and implementing in a couple of places (#19534) This is a new op system that will eventually replace `#[op]`. Features - More maintainable, generally less-coupled code - More modern Rust proc-macro libraries - Enforces correct `fast` labelling for fast ops, allowing for visual scanning of fast ops - Explicit marking of `#[string]`, `#[serde]` and `#[smi]` parameters. This first version of op2 supports integer and Option parameters only, and allows us to start working on converting ops and adding features. --- core/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/lib.rs') diff --git a/core/lib.rs b/core/lib.rs index 1f069e661..9a960e93a 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -41,6 +41,7 @@ pub use url; pub use v8; pub use deno_ops::op; +pub use deno_ops::op2; pub use crate::async_cancel::CancelFuture; pub use crate::async_cancel::CancelHandle; @@ -130,6 +131,7 @@ pub fn v8_version() -> &'static str { pub mod _ops { pub use super::error::throw_type_error; pub use super::error_codes::get_error_code; + pub use super::extensions::OpDecl; pub use super::ops::to_op_result; pub use super::ops::OpCtx; pub use super::ops::OpResult; @@ -139,10 +141,17 @@ pub mod _ops { pub use super::runtime::ops::map_async_op4; pub use super::runtime::ops::queue_async_op; pub use super::runtime::ops::queue_fast_async_op; + pub use super::runtime::ops::to_i32; + pub use super::runtime::ops::to_u32; pub use super::runtime::V8_WRAPPER_OBJECT_INDEX; pub use super::runtime::V8_WRAPPER_TYPE_INDEX; } +pub(crate) mod deno_core { + pub(crate) use crate::_ops; + pub(crate) use crate::v8; +} + // TODO(mmastrac): Temporary while we move code around pub mod snapshot_util { pub use crate::runtime::create_snapshot; -- cgit v1.2.3