summaryrefslogtreecommitdiff
path: root/runtime/js.rs
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-02-08 22:40:18 +0100
committerGitHub <noreply@github.com>2023-02-08 22:40:18 +0100
commit286e5d0be9bb11a69d55f0eedd4a6678b0d48e7d (patch)
tree37399e924de155fbcbeab975222bdb16f257e228 /runtime/js.rs
parentbef50416b92a3ed7bf44b361fc5360f9a52c83e6 (diff)
refactor: internal runtime code TS support (#17672)
This is a proof of concept for being able to snapshot TypeScript files. Currently only a single runtime file is authored in TypeScript - "runtime/js/01_version.ts". Not needed infrastructure was removed from "core/snapshot_util.rs". --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/js.rs')
-rw-r--r--runtime/js.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/runtime/js.rs b/runtime/js.rs
index 3d14c744c..82e58a09c 100644
--- a/runtime/js.rs
+++ b/runtime/js.rs
@@ -2,7 +2,6 @@
use deno_core::Snapshot;
use log::debug;
use once_cell::sync::Lazy;
-use std::path::PathBuf;
pub static RUNTIME_SNAPSHOT: Lazy<Box<[u8]>> = Lazy::new(
#[allow(clippy::uninit_vec)]
@@ -35,8 +34,5 @@ pub fn deno_isolate_init() -> Snapshot {
Snapshot::Static(&RUNTIME_SNAPSHOT)
}
-pub fn get_99_main() -> PathBuf {
- let manifest = env!("CARGO_MANIFEST_DIR");
- let path = PathBuf::from(manifest);
- path.join("js").join("99_main.js")
-}
+#[cfg(feature = "snapshot_from_snapshot")]
+pub static SOURCE_CODE_FOR_99_MAIN_JS: &str = include_str!("js/99_main.js");