mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
fix(compile): panic when running with a populated dep analysis cache (#15672)
Closes #15612
This commit is contained in:
parent
b62ef4d37b
commit
c3e48cba18
6 changed files with 64 additions and 51 deletions
8
cli/cache/parsed_source.rs
vendored
8
cli/cache/parsed_source.rs
vendored
|
@ -88,7 +88,7 @@ impl ParsedSourceCache {
|
|||
source: Arc<str>,
|
||||
media_type: MediaType,
|
||||
) -> deno_core::anyhow::Result<ParsedSource, deno_ast::Diagnostic> {
|
||||
let parser = CapturingModuleParser::new(None, &self.sources);
|
||||
let parser = self.as_capturing_parser();
|
||||
// this will conditionally parse because it's using a CapturingModuleParser
|
||||
parser.parse_module(specifier, source, media_type)
|
||||
}
|
||||
|
@ -124,6 +124,12 @@ impl ParsedSourceCache {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a parser that will reuse a ParsedSource from the store
|
||||
/// if it exists, or else parse.
|
||||
pub fn as_capturing_parser(&self) -> CapturingModuleParser {
|
||||
CapturingModuleParser::new(None, &self.sources)
|
||||
}
|
||||
}
|
||||
|
||||
struct ParsedSourceCacheModuleAnalyzer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue