summaryrefslogtreecommitdiff
path: root/runtime/js.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js.rs')
-rw-r--r--runtime/js.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/runtime/js.rs b/runtime/js.rs
index def2724ce..f942493a3 100644
--- a/runtime/js.rs
+++ b/runtime/js.rs
@@ -1,17 +1,21 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-#[cfg(not(feature = "dont_create_runtime_snapshot"))]
use deno_core::Snapshot;
-#[cfg(not(feature = "dont_create_runtime_snapshot"))]
use log::debug;
#[cfg(not(feature = "dont_create_runtime_snapshot"))]
static RUNTIME_SNAPSHOT: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/RUNTIME_SNAPSHOT.bin"));
-#[cfg(not(feature = "dont_create_runtime_snapshot"))]
-pub fn deno_isolate_init() -> Snapshot {
+pub fn deno_isolate_init() -> Option<Snapshot> {
debug!("Deno isolate init with snapshots.");
- Snapshot::Static(RUNTIME_SNAPSHOT)
+ #[cfg(not(feature = "dont_create_runtime_snapshot"))]
+ {
+ Some(Snapshot::Static(RUNTIME_SNAPSHOT))
+ }
+ #[cfg(feature = "dont_create_runtime_snapshot")]
+ {
+ None
+ }
}
#[cfg(not(feature = "include_js_files_for_snapshotting"))]