deno/runtime/js.rs
Nayeem Rahman 28a4f3d0f5
Reland "refactor(core): cleanup feature flags for js source inclusion" (#19519)
Relands #19463. This time the `ExtensionFileSourceCode` enum is
preserved, so this effectively just splits feature
`include_js_for_snapshotting` into `exclude_js_sources` and
`runtime_js_sources`, adds a `force_include_js_sources` option on
`extension!()`, and unifies `ext::Init_ops_and_esm()` and
`ext::init_ops()` into `ext::init()`.
2023-06-25 09:35:31 +02:00

22 lines
808 B
Rust

// 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 {
debug!("Deno isolate init with snapshots.");
Snapshot::Static(RUNTIME_SNAPSHOT)
}
/// Depends on LTO to be excluded from production binaries if unused.
pub static SOURCE_CODE_FOR_99_MAIN_JS: &str = include_str!("js/99_main.js");
pub static PATH_FOR_99_MAIN_JS: &str =
concat!(env!("CARGO_MANIFEST_DIR"), "/js/99_main.js");