From e55b448730160a6e4df9815a268d4049ac89deab Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Fri, 17 Mar 2023 12:22:15 -0600 Subject: feat(core) deno_core::extension! macro to simplify extension registration (#18210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This implements two macros to simplify extension registration and centralize a lot of the boilerplate as a base for future improvements: * `deno_core::ops!` registers a block of `#[op]`s, optionally with type parameters, useful for places where we share lists of ops * `deno_core::extension!` is used to register an extension, and creates two methods that can be used at runtime/snapshot generation time: `init_ops` and `init_ops_and_esm`. --------- Co-authored-by: Bartek IwaƄczuk --- cli/tools/bench.rs | 2 +- cli/tools/test.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/bench.rs b/cli/tools/bench.rs index 0aa7cc365..6cc2a22f0 100644 --- a/cli/tools/bench.rs +++ b/cli/tools/bench.rs @@ -441,7 +441,7 @@ async fn bench_specifier( &ps, specifier, PermissionsContainer::new(permissions), - vec![ops::bench::init(channel, filter)], + vec![ops::bench::deno_bench::init_ops(channel, filter)], Default::default(), ) .await?; diff --git a/cli/tools/test.rs b/cli/tools/test.rs index d200a3029..0d9637c3d 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -723,7 +723,7 @@ async fn test_specifier( ps, specifier, PermissionsContainer::new(permissions), - vec![ops::testing::init( + vec![ops::testing::deno_test::init_ops( sender, fail_fast_tracker, options.filter, -- cgit v1.2.3