summaryrefslogtreecommitdiff
path: root/core/extensions.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2023-04-12 15:13:32 +0200
committerGitHub <noreply@github.com>2023-04-12 15:13:32 +0200
commitf90caa821c5a4acf28f7dec4071994ecf6f26e57 (patch)
treefa4af65399a16a9f2d17fa2b249f21be2c00b976 /core/extensions.rs
parent0e3f62d4446ae7b9a64dacf7befcaecede118222 (diff)
refactor(ext/fs): abstract FS via FileSystem trait (#18599)
This commit abstracts out the specifics of the underlying system calls FS operations behind a new `FileSystem` and `File` trait in the `ext/fs` extension. This allows other embedders to re-use ext/fs, but substituting in a different FS backend. This is likely not the final form of these traits. Eventually they will be entirely `deno_core::Resource` agnostic, and will live in a seperate crate. --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'core/extensions.rs')
-rw-r--r--core/extensions.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/extensions.rs b/core/extensions.rs
index 4a7b49414..685ac0ab7 100644
--- a/core/extensions.rs
+++ b/core/extensions.rs
@@ -180,7 +180,7 @@ macro_rules! extension {
$(, deps = [ $( $dep:ident ),* ] )?
$(, parameters = [ $( $param:ident : $type:ident ),+ ] )?
$(, ops_fn = $ops_symbol:ident $( < $ops_param:ident > )? )?
- $(, ops = [ $( $(#[$m:meta])* $( $op:ident )::+ $( < $op_param:ident > )? ),+ $(,)? ] )?
+ $(, ops = [ $( $(#[$m:meta])* $( $op:ident )::+ $( < $( $op_param:ident ),* > )? ),+ $(,)? ] )?
$(, esm_entry_point = $esm_entry_point:literal )?
$(, esm = [ $( dir $dir_esm:literal , )? $( $esm:literal ),* $(,)? ] )?
$(, esm_setup_script = $esm_setup_script:expr )?
@@ -235,7 +235,7 @@ macro_rules! extension {
ext.ops(vec![
$(
$( #[ $m ] )*
- $( $op )::+ :: decl $( :: <$op_param> )? ()
+ $( $op )::+ :: decl $( :: < $($op_param),* > )? ()
),+
]);
)?
@@ -267,11 +267,11 @@ macro_rules! extension {
}
#[allow(dead_code)]
- pub fn init_js_only $( < $( $param : $type + 'static ),+ > )? () -> $crate::Extension {
+ pub fn init_js_only $( < $( $param : $type + 'static ),* > )? () -> $crate::Extension {
let mut ext = Self::ext();
// If esm or JS was specified, add JS files
Self::with_js(&mut ext);
- Self::with_ops $( ::<($( $param ),+)> )?(&mut ext);
+ Self::with_ops $( ::< $( $param ),+ > )?(&mut ext);
Self::with_customizer(&mut ext);
ext.take()
}
@@ -281,8 +281,8 @@ macro_rules! extension {
let mut ext = Self::ext();
// If esm or JS was specified, add JS files
Self::with_js(&mut ext);
- Self::with_ops $( ::<($( $param ),+)> )?(&mut ext);
- Self::with_state_and_middleware $( ::<($( $param ),+)> )?(&mut ext, $( $( $options_id , )* )? );
+ Self::with_ops $( ::< $( $param ),+ > )?(&mut ext);
+ Self::with_state_and_middleware $( ::< $( $param ),+ > )?(&mut ext, $( $( $options_id , )* )? );
Self::with_customizer(&mut ext);
ext.take()
}
@@ -290,8 +290,8 @@ macro_rules! extension {
#[allow(dead_code)]
pub fn init_ops $( < $( $param : $type + 'static ),+ > )? ( $( $( $options_id : $options_type ),* )? ) -> $crate::Extension {
let mut ext = Self::ext();
- Self::with_ops $( ::<($( $param ),+)> )?(&mut ext);
- Self::with_state_and_middleware $( ::<($( $param ),+)> )?(&mut ext, $( $( $options_id , )* )? );
+ Self::with_ops $( ::< $( $param ),+ > )?(&mut ext);
+ Self::with_state_and_middleware $( ::< $( $param ),+ > )?(&mut ext, $( $( $options_id , )* )? );
Self::with_customizer(&mut ext);
ext.take()
}