-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup(cli): use op Extensions (#13223)
Enabling op-middleware for overrides in lieu of imperative .replace_op() etc... Impacts #13219, #12938, #13122
- Loading branch information
1 parent
27fa51d
commit 4a1ab26
Showing
8 changed files
with
87 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. | ||
|
||
pub mod errors; | ||
pub mod runtime_compiler; | ||
use crate::proc_state::ProcState; | ||
use deno_core::Extension; | ||
|
||
mod errors; | ||
mod runtime_compiler; | ||
pub mod testing; | ||
|
||
pub use deno_runtime::ops::{reg_async, reg_sync}; | ||
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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.