mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
fix(cli): check for inline source maps before external ones (#9394)
Fixes #6965
This commit is contained in:
parent
45b465f839
commit
0cac243a83
3 changed files with 33 additions and 6 deletions
|
@ -296,12 +296,8 @@ impl SourceMapGetter for ProgramState {
|
|||
fn get_source_map(&self, file_name: &str) -> Option<Vec<u8>> {
|
||||
if let Ok(specifier) = ModuleSpecifier::resolve_url(file_name) {
|
||||
if let Some((code, maybe_map)) = self.get_emit(&specifier.as_url()) {
|
||||
if maybe_map.is_some() {
|
||||
maybe_map
|
||||
} else {
|
||||
let code = String::from_utf8(code).unwrap();
|
||||
source_map_from_code(code)
|
||||
}
|
||||
let code = String::from_utf8(code).unwrap();
|
||||
source_map_from_code(code).or(maybe_map)
|
||||
} else if let Ok(source) = self.load(specifier, None) {
|
||||
source_map_from_code(source.code)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue