summaryrefslogtreecommitdiff
path: root/cli/tools/repl/session.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-06-05 11:04:16 -0400
committerGitHub <noreply@github.com>2024-06-05 17:04:16 +0200
commit7ed90a20d04982ae15a52ae2378cbffd4b6839df (patch)
tree3297d6f7227fbf1cf80e17a2a376ef4dfa52e6ad /cli/tools/repl/session.rs
parent0544d60012006b1c7799d8b6eafacec9567901ad (diff)
fix: better handling of npm resolution occurring on workers (#24094)
Closes https://github.com/denoland/deno/issues/24063
Diffstat (limited to 'cli/tools/repl/session.rs')
-rw-r--r--cli/tools/repl/session.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs
index 1bc8a96d0..b122713c0 100644
--- a/cli/tools/repl/session.rs
+++ b/cli/tools/repl/session.rs
@@ -639,10 +639,11 @@ impl ReplSession {
source_map: deno_ast::SourceMapOption::None,
source_map_file: None,
inline_sources: false,
- keep_comments: false,
+ remove_comments: false,
},
)?
.into_source()
+ .into_string()?
.text;
let value = self
@@ -817,7 +818,7 @@ fn parse_source_as(
let parsed = deno_ast::parse_module(deno_ast::ParseParams {
specifier,
- text_info: deno_ast::SourceTextInfo::from_string(source),
+ text: source.into(),
media_type,
capture_tokens: true,
maybe_syntax: None,
@@ -884,7 +885,7 @@ fn analyze_jsx_pragmas(
range: comment_source_to_position_range(
c.start(),
&m,
- parsed_source.text_info(),
+ parsed_source.text_info_lazy(),
true,
),
});
@@ -898,7 +899,7 @@ fn analyze_jsx_pragmas(
range: comment_source_to_position_range(
c.start(),
&m,
- parsed_source.text_info(),
+ parsed_source.text_info_lazy(),
false,
),
});
@@ -912,7 +913,7 @@ fn analyze_jsx_pragmas(
range: comment_source_to_position_range(
c.start(),
&m,
- parsed_source.text_info(),
+ parsed_source.text_info_lazy(),
false,
),
});