From 28a4f3d0f5383695b1d49ccdc8b0f799a715b2c2 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sun, 25 Jun 2023 08:35:31 +0100 Subject: 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()`. --- runtime/js.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/js.rs') diff --git a/runtime/js.rs b/runtime/js.rs index def2724ce..099ca0c0e 100644 --- a/runtime/js.rs +++ b/runtime/js.rs @@ -14,9 +14,8 @@ pub fn deno_isolate_init() -> Snapshot { Snapshot::Static(RUNTIME_SNAPSHOT) } -#[cfg(not(feature = "include_js_files_for_snapshotting"))] +/// 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"); -#[cfg(feature = "include_js_files_for_snapshotting")] pub static PATH_FOR_99_MAIN_JS: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/js/99_main.js"); -- cgit v1.2.3