summaryrefslogtreecommitdiff
path: root/runtime/shared.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/shared.rs')
-rw-r--r--runtime/shared.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/shared.rs b/runtime/shared.rs
index 61f9ca225..1b2136c63 100644
--- a/runtime/shared.rs
+++ b/runtime/shared.rs
@@ -4,7 +4,6 @@
use deno_ast::MediaType;
use deno_ast::ParseParams;
use deno_ast::SourceMapOption;
-use deno_ast::SourceTextInfo;
use deno_core::error::AnyError;
use deno_core::extension;
use deno_core::Extension;
@@ -88,7 +87,7 @@ pub fn maybe_transpile_source(
let parsed = deno_ast::parse_module(ParseParams {
specifier: deno_core::url::Url::parse(&name).unwrap(),
- text_info: SourceTextInfo::from_string(source.as_str().to_owned()),
+ text: source.into(),
media_type,
capture_tokens: false,
scope_analysis: false,
@@ -111,9 +110,9 @@ pub fn maybe_transpile_source(
)?
.into_source();
- let maybe_source_map: Option<SourceMapData> = transpiled_source
- .source_map
- .map(|sm| sm.into_bytes().into());
+ let maybe_source_map: Option<SourceMapData> =
+ transpiled_source.source_map.map(|sm| sm.into());
+ let source_text = String::from_utf8(transpiled_source.source)?;
- Ok((transpiled_source.text.into(), maybe_source_map))
+ Ok((source_text.into(), maybe_source_map))
}