mirror of
https://github.com/denoland/deno.git
synced 2025-01-09 07:39:15 -05:00
rename script_source to script_runtime_source
This commit is contained in:
parent
770ef14600
commit
2366db4e92
1 changed files with 4 additions and 4 deletions
|
@ -196,16 +196,16 @@ pub struct CoverageReport {
|
||||||
|
|
||||||
fn generate_coverage_report(
|
fn generate_coverage_report(
|
||||||
script_coverage: &cdp::ScriptCoverage,
|
script_coverage: &cdp::ScriptCoverage,
|
||||||
script_source: String,
|
script_runtime_source: String,
|
||||||
maybe_source_map: &Option<Vec<u8>>,
|
maybe_source_map: &Option<Vec<u8>>,
|
||||||
output: &Option<PathBuf>,
|
output: &Option<PathBuf>,
|
||||||
) -> CoverageReport {
|
) -> CoverageReport {
|
||||||
let maybe_source_map = maybe_source_map
|
let maybe_source_map = maybe_source_map
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|source_map| SourceMap::from_slice(source_map).unwrap());
|
.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()
|
.into_iter()
|
||||||
.filter(|item| {
|
.filter(|item| {
|
||||||
matches!(item.inner, deno_ast::TokenOrComment::Comment { .. })
|
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 line_end_char_offset = text_lines.char_index(line_end_byte_offset);
|
||||||
let ignore = comment_ranges.iter().any(|range| {
|
let ignore = comment_ranges.iter().any(|range| {
|
||||||
range.start <= line_start_byte_offset && range.end >= line_end_byte_offset
|
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]
|
[line_start_byte_offset..line_end_byte_offset]
|
||||||
.trim()
|
.trim()
|
||||||
.is_empty();
|
.is_empty();
|
||||||
|
|
Loading…
Reference in a new issue