diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-01-01 06:24:05 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-01-03 09:45:40 -0500 |
commit | 7024d9f25394453d49486d5b2b1b5da6d369acb9 (patch) | |
tree | a54e95908fae946d7711bef0c90b27a0536921c8 /src/deno_dir.rs | |
parent | bba0ed3185f30218e015ccd32cc0c8ae14ebba01 (diff) |
Add rust binding and test for deno_execute_mod()
Diffstat (limited to 'src/deno_dir.rs')
-rw-r--r-- | src/deno_dir.rs | 9 |
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 { |