mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
refactor(cli): add Emitter
struct (#18690)
Removes the functions in the `emit` module and replaces them with an `Emitter` struct that can have "ctor dependencies" injected rather than using functions to pass along the dependencies. This is part of a long term refactor to move more functionality out of proc state.
This commit is contained in:
parent
6e8618ae0f
commit
d192d84a0e
5 changed files with 102 additions and 80 deletions
|
@ -4,7 +4,6 @@ use crate::args::CoverageFlags;
|
|||
use crate::args::FileFlags;
|
||||
use crate::args::Flags;
|
||||
use crate::colors;
|
||||
use crate::emit::get_source_hash;
|
||||
use crate::proc_state::ProcState;
|
||||
use crate::tools::fmt::format_json;
|
||||
use crate::util::fs::FileCollector;
|
||||
|
@ -698,7 +697,7 @@ pub async fn cover_files(
|
|||
| MediaType::Mts
|
||||
| MediaType::Cts
|
||||
| MediaType::Tsx => {
|
||||
let source_hash = get_source_hash(&file.source, ps.emit_options_hash);
|
||||
let source_hash = ps.emitter.get_source_hash(&file.source);
|
||||
match ps.emit_cache.get_emit_code(&file.specifier, source_hash) {
|
||||
Some(code) => code.into(),
|
||||
None => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue