Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/inner_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use deno_core::{
JsRuntimeForSnapshot, PollEventLoopOptions,
};
use serde::de::DeserializeOwned;
use std::sync::Arc;
use std::{
collections::{HashMap, HashSet},
path::{Path, PathBuf},
Expand Down Expand Up @@ -745,7 +746,8 @@ impl<RT: RuntimeTrait> InnerRuntime<RT> {
.translate_cjs(&module_specifier, &code)
.await?;

let fast_code = deno_core::FastString::from(code.clone());
let arc_code: Arc<str> = Arc::from(code);
let fast_code = deno_core::FastString::from(arc_code.clone());

let s_modid = self
.deno_runtime()
Expand All @@ -755,7 +757,7 @@ impl<RT: RuntimeTrait> InnerRuntime<RT> {
// Update source map cache
self.module_loader.insert_source_map(
module_specifier.as_str(),
code,
arc_code.to_string(),
sourcemap.map(|s| s.to_vec()),
);

Expand All @@ -777,7 +779,8 @@ impl<RT: RuntimeTrait> InnerRuntime<RT> {
.translate_cjs(&module_specifier, &code)
.await?;

let fast_code = deno_core::FastString::from(code.clone());
let arc_code: Arc<str> = Arc::from(code);
let fast_code = deno_core::FastString::from(arc_code.clone());

let module_id = self
.deno_runtime()
Expand All @@ -787,7 +790,7 @@ impl<RT: RuntimeTrait> InnerRuntime<RT> {
// Update source map cache
self.module_loader.insert_source_map(
module_specifier.as_str(),
code,
arc_code.to_string(),
sourcemap.map(|s| s.to_vec()),
);

Expand Down
Loading