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 --- ext/webidl/benches/dict.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/webidl/benches') diff --git a/ext/webidl/benches/dict.rs b/ext/webidl/benches/dict.rs index 2ed9adf78..89a83ddaa 100644 --- a/ext/webidl/benches/dict.rs +++ b/ext/webidl/benches/dict.rs @@ -11,7 +11,7 @@ use deno_core::ExtensionFileSourceCode; fn setup() -> Vec { vec![ - deno_webidl::init_esm(), + deno_webidl::deno_webidl::init_ops_and_esm(), Extension::builder("deno_webidl_bench") .esm(vec![ExtensionFileSource { specifier: "ext:setup".to_string(), -- cgit v1.2.3