diff options
| author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-01-08 23:48:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-08 23:48:46 +0100 |
| commit | c41d4ff90e09b63bd1894052352a5acba57b1704 (patch) | |
| tree | 52be95551ed263c2f4831aaefc78bb6fdda6d89c /runtime | |
| parent | 2be1282be42369e558cc77f75b22488ce7a8215e (diff) | |
feat(core): allow specifying name and dependencies of an Extension (#17301)
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/ops/fs.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/fs_events.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/http.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/io.rs | 4 | ||||
| -rw-r--r-- | runtime/ops/os/mod.rs | 4 | ||||
| -rw-r--r-- | runtime/ops/permissions.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/process.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/runtime.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/signal.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/spawn.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/tty.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/web_worker.rs | 2 | ||||
| -rw-r--r-- | runtime/ops/worker_host.rs | 2 | ||||
| -rw-r--r-- | runtime/web_worker.rs | 2 | ||||
| -rw-r--r-- | runtime/worker.rs | 2 |
15 files changed, 17 insertions, 17 deletions
diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs index 87bb090c3..fe263d944 100644 --- a/runtime/ops/fs.rs +++ b/runtime/ops/fs.rs @@ -42,7 +42,7 @@ use deno_core::error::generic_error; use deno_core::error::not_supported; pub fn init() -> Extension { - Extension::builder() + Extension::builder("deno_fs") .ops(vec![ op_open_sync::decl(), op_open_async::decl(), diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs index 6cda48ef3..e550d204c 100644 --- a/runtime/ops/fs_events.rs +++ b/runtime/ops/fs_events.rs @@ -30,7 +30,7 @@ use std::rc::Rc; use tokio::sync::mpsc; pub fn init() -> Extension { - Extension::builder() + Extension::builder("deno_fs_events") .ops(vec![op_fs_events_open::decl(), op_fs_events_poll::decl()]) .build() } diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs index e751adae8..a531deb84 100644 --- a/runtime/ops/http.rs +++ b/runtime/ops/http.rs @@ -27,7 +27,7 @@ use deno_net::io::UnixStreamResource; use tokio::net::UnixStream; pub fn init() -> Extension { - Extension::builder() + Extension::builder("deno_http_runtime") .ops(vec![ op_http_start::decl(), op_http_upgrade::decl(), diff --git a/runtime/ops/io.rs b/runtime/ops/io.rs index 3bee7db60..43016395e 100644 --- a/runtime/ops/io.rs +++ b/runtime/ops/io.rs @@ -76,7 +76,7 @@ pub static STDERR_HANDLE: Lazy<StdFile> = Lazy::new(|| { }); pub fn init() -> Extension { - Extension::builder() + Extension::builder("deno_io") .ops(vec![op_read_sync::decl(), op_write_sync::decl()]) .build() } @@ -114,7 +114,7 @@ pub fn init_stdio(stdio: Stdio) -> Extension { // todo(dsheret): don't do this? Taking out the writers was necessary to prevent invalid handle panics let stdio = Rc::new(RefCell::new(Some(stdio))); - Extension::builder() + Extension::builder("deno_stdio") .middleware(|op| match op.name { "op_print" => op_print::decl(), _ => op, diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs index 537bb33f9..fec7629f5 100644 --- a/runtime/ops/os/mod.rs +++ b/runtime/ops/os/mod.rs @@ -40,7 +40,7 @@ fn init_ops(builder: &mut ExtensionBuilder) -> &mut ExtensionBuilder { } pub fn init(exit_code: ExitCode) -> Extension { - let mut builder = Extension::builder(); + let mut builder = Extension::builder("deno_os"); init_ops(&mut builder) .state(move |state| { state.put::<ExitCode>(exit_code.clone()); @@ -50,7 +50,7 @@ pub fn init(exit_code: ExitCode) -> Extension { } pub fn init_for_worker() -> Extension { - let mut builder = Extension::builder(); + let mut builder = Extension::builder("deno_os_worker"); init_ops(&mut builder) .middleware(|op| match op.name { "op_exit" => noop_op::decl(), diff --git a/runtime/ops/permissions.rs b/runtime/ops/permissions.rs index d0b0cdd8b..2b01da0a9 100644 --- a/runtime/ops/permissions.rs +++ b/runtime/ops/permissions.rs @@ -13,7 +13,7 @@ use serde::Deserialize; use std::path::Path; pub fn init() -> Extension { - Extension::builder() + Extension::builder("deno_permissions") .ops(vec![ op_query_permission::decl(), op_revoke_permission::decl(), diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index 86ad292b8..75d9cfdc9 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -27,7 +27,7 @@ use tokio::process::Command; use std::os::unix::process::ExitStatusExt; pub fn init() -> Extension { - Extension::builder() + Extension::builder("deno_process") .ops(vec![op_run::decl(), op_run_status::decl(), op_kill::decl()]) .build() } diff --git a/runtime/ops/runtime.rs b/runtime/ops/runtime.rs index 52dc3f745..b97741acc 100644 --- a/runtime/ops/runtime.rs +++ b/runtime/ops/runtime.rs @@ -9,7 +9,7 @@ use deno_core::ModuleSpecifier; use deno_core::OpState; pub fn init(main_module: ModuleSpecifier) -> Extension { - Extension::builder() + Extension::builder("deno_runtime") .ops(vec![op_main_module::decl()]) .state(move |state| { state.put::<ModuleSpecifier>(main_module.clone()); diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs index 14a9215ed..0af9a5c44 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -21,7 +21,7 @@ use tokio::signal::unix::{signal, Signal, SignalKind}; use tokio::signal::windows::{ctrl_break, ctrl_c, CtrlBreak, CtrlC}; pub fn init() -> Extension { - Extension::builder() + Extension::builder("deno_signal") .ops(vec