summaryrefslogtreecommitdiff
path: root/cli/tools/test.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-05-20 16:40:55 -0400
committerGitHub <noreply@github.com>2022-05-20 16:40:55 -0400
commit1fcecb6789c3f111bc1554766ba9347afcfd02dc (patch)
tree19cd1b121412b992994b2fe4bea0463793d3986e /cli/tools/test.rs
parente7c894e8f54ebd2d9fd61c97a265906ac54e2068 (diff)
refactor: upgrade to deno_ast 0.15 (#14680)
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r--cli/tools/test.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index 97507c536..4424ee28d 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -29,6 +29,7 @@ use crate::tools::coverage::CoverageCollector;
use deno_ast::swc::common::comments::CommentKind;
use deno_ast::MediaType;
+use deno_ast::SourceRangedForSpanned;
use deno_core::error::generic_error;
use deno_core::error::AnyError;
use deno_core::error::JsError;
@@ -825,7 +826,7 @@ fn extract_files_from_regex_blocks(
local: file_specifier.to_file_path().unwrap(),
maybe_types: None,
media_type: file_media_type,
- source: Arc::new(file_source),
+ source: file_source.into(),
specifier: file_specifier,
maybe_headers: None,
})
@@ -837,12 +838,12 @@ fn extract_files_from_regex_blocks(
fn extract_files_from_source_comments(
specifier: &ModuleSpecifier,
- source: Arc<String>,
+ source: Arc<str>,
media_type: MediaType,
) -> Result<Vec<File>, AnyError> {
let parsed_source = deno_ast::parse_module(deno_ast::ParseParams {
specifier: specifier.as_str().to_string(),
- source: deno_ast::SourceTextInfo::new(source),
+ text_info: deno_ast::SourceTextInfo::new(source),
media_type,
capture_tokens: false,
maybe_syntax: None,
@@ -866,7 +867,7 @@ fn extract_files_from_source_comments(
specifier,
&comment.text,
media_type,
- parsed_source.source().line_index(comment.span.lo),
+ parsed_source.text_info().line_index(comment.start()),
&blocks_regex,
&lines_regex,
)