1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-27 16:10:57 -05:00
denoland-deno/cli/ops/mod.rs
Ryan Dahl 4775d57867
chore: update copyright to 2022 (#13306)
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-12 16:24:10 +01:00

29 lines
609 B
Rust

// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
use crate::proc_state::ProcState;
use deno_core::Extension;
mod errors;
mod runtime_compiler;
pub mod testing;
pub fn cli_exts(ps: ProcState, enable_compiler: bool) -> Vec<Extension> {
if enable_compiler {
vec![
init_proc_state(ps),
errors::init(),
runtime_compiler::init(),
]
} else {
vec![init_proc_state(ps), errors::init()]
}
}
fn init_proc_state(ps: ProcState) -> Extension {
Extension::builder()
.state(move |state| {
state.put(ps.clone());
Ok(())
})
.build()
}