summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 2a838c0f6..1fac28c6a 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -308,7 +308,7 @@ impl MainWorker {
});
// NOTE(bartlomieju): ordering is important here, keep it in sync with
- // `runtime/build.rs`, `runtime/web_worker.rs` and `runtime/snapshot.rs`!
+ // `runtime/web_worker.rs` and `runtime/snapshot.rs`!
let mut extensions = vec![
// Web APIs
deno_webidl::deno_webidl::init_ops_and_esm(),
@@ -428,8 +428,17 @@ impl MainWorker {
extensions.extend(std::mem::take(&mut options.extensions));
- #[cfg(all(feature = "include_js_files_for_snapshotting", feature = "dont_create_runtime_snapshot", not(feature = "__runtime_js_sources")))]
- options.startup_snapshot.as_ref().expect("Sources are not embedded, snapshotting was disabled and a user snapshot was not provided.");
+ #[cfg(all(
+ feature = "include_js_files_for_snapshotting",
+ not(feature = "__runtime_js_sources")
+ ))]
+ options
+ .startup_snapshot
+ .as_ref()
+ .expect("Sources are not embedded and a user snapshot was not provided.");
+
+ #[cfg(not(feature = "dont_use_runtime_snapshot"))]
+ options.startup_snapshot.as_ref().expect("A user snapshot was not provided, if you want to create a runtime without a snapshot use 'dont_use_runtime_snapshot' Cargo feature.");
let has_notified_of_inspector_disconnect = AtomicBool::new(false);
let wait_for_inspector_disconnect_callback = Box::new(move || {
@@ -442,9 +451,7 @@ impl MainWorker {
let mut js_runtime = JsRuntime::new(RuntimeOptions {
module_loader: Some(options.module_loader.clone()),
- startup_snapshot: options
- .startup_snapshot
- .or_else(crate::js::deno_isolate_init),
+ startup_snapshot: options.startup_snapshot,
create_params: options.create_params,
source_map_getter: options.source_map_getter,
skip_op_registration: options.skip_op_registration,