summaryrefslogtreecommitdiff
path: root/src/deno_dir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/deno_dir.rs')
-rw-r--r--src/deno_dir.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/deno_dir.rs b/src/deno_dir.rs
index 5ae1c66d9..71a0f7a12 100644
--- a/src/deno_dir.rs
+++ b/src/deno_dir.rs
@@ -28,6 +28,15 @@ pub struct CodeFetchOutput {
pub maybe_source_map: Option<Vec<u8>>,
}
+impl CodeFetchOutput {
+ pub fn js_source<'a>(&'a self) -> &'a Vec<u8> {
+ match self.maybe_output_code {
+ None => &self.source_code,
+ Some(ref output_code) => output_code,
+ }
+ }
+}
+
/// Gets corresponding MediaType given extension
fn extmap(ext: &str) -> msg::MediaType {
match ext {