From 2366db4e928097b70168accce269d6ffca82231b Mon Sep 17 00:00:00 2001 From: Ben Heidemann Date: Sat, 26 Oct 2024 11:42:35 +0100 Subject: [PATCH] rename script_source to script_runtime_source --- cli/tools/coverage/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/tools/coverage/mod.rs b/cli/tools/coverage/mod.rs index f593332475..3e4481cc41 100644 --- a/cli/tools/coverage/mod.rs +++ b/cli/tools/coverage/mod.rs @@ -196,16 +196,16 @@ pub struct CoverageReport { fn generate_coverage_report( script_coverage: &cdp::ScriptCoverage, - script_source: String, + script_runtime_source: String, maybe_source_map: &Option>, output: &Option, ) -> CoverageReport { let maybe_source_map = maybe_source_map .as_ref() .map(|source_map| SourceMap::from_slice(source_map).unwrap()); - let text_lines = TextLines::new(&script_source); + let text_lines = TextLines::new(&script_runtime_source); - let comment_ranges = deno_ast::lex(&script_source, MediaType::JavaScript) + let comment_ranges = deno_ast::lex(&script_runtime_source, MediaType::JavaScript) .into_iter() .filter(|item| { matches!(item.inner, deno_ast::TokenOrComment::Comment { .. }) @@ -286,7 +286,7 @@ fn generate_coverage_report( let line_end_char_offset = text_lines.char_index(line_end_byte_offset); let ignore = comment_ranges.iter().any(|range| { range.start <= line_start_byte_offset && range.end >= line_end_byte_offset - }) || script_source + }) || script_runtime_source [line_start_byte_offset..line_end_byte_offset] .trim() .is_empty();