summaryrefslogtreecommitdiff
path: root/cli/proc_state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/proc_state.rs')
-rw-r--r--cli/proc_state.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/proc_state.rs b/cli/proc_state.rs
index d4173ee2e..8df68d15b 100644
--- a/cli/proc_state.rs
+++ b/cli/proc_state.rs
@@ -592,7 +592,7 @@ impl ProcState {
}
};
Ok(ModuleSource {
- code,
+ code: code.into_bytes().into_boxed_slice(),
module_url_specified: specifier.to_string(),
module_url_found: found.to_string(),
module_type: match media_type {
@@ -646,7 +646,8 @@ impl SourceMapGetter for ProcState {
let code = String::from_utf8(code).unwrap();
source_map_from_code(code).or(maybe_map)
} else if let Ok(source) = self.load(specifier, None, false) {
- source_map_from_code(source.code)
+ let code = String::from_utf8(source.code.to_vec()).unwrap();
+ source_map_from_code(code)
} else {
None
}