mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
fix(cli): local sources are not cached in memory (#8328)
Fixes #4743 Closes #5253 Fixes #5631 Fixes #6116 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
This commit is contained in:
parent
1079e59cf4
commit
37fbbf8101
3 changed files with 84 additions and 27 deletions
|
@ -188,7 +188,7 @@ impl ProgramState {
|
|||
// really should just be getting this from the module graph.
|
||||
let out = self
|
||||
.file_fetcher
|
||||
.get_cached(&module_specifier)
|
||||
.get_source(&module_specifier)
|
||||
.expect("Cached source file doesn't exist");
|
||||
|
||||
let specifier = out.specifier.clone();
|
||||
|
@ -323,7 +323,7 @@ impl SourceMapGetter for ProgramState {
|
|||
line_number: usize,
|
||||
) -> Option<String> {
|
||||
if let Ok(specifier) = ModuleSpecifier::resolve_url(file_name) {
|
||||
self.file_fetcher.get_cached(&specifier).map(|out| {
|
||||
self.file_fetcher.get_source(&specifier).map(|out| {
|
||||
// Do NOT use .lines(): it skips the terminating empty line.
|
||||
// (due to internally using .split_terminator() instead of .split())
|
||||
let lines: Vec<&str> = out.source.split('\n').collect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue