From 14aaa73c0200d7fac4aa224d623e28b5955daab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 26 Apr 2023 19:57:38 +0200 Subject: refactor: don't expose Deno[Deno.internal].core namespace (#18816) --- core/01_core.js | 8 +++++--- core/runtime.rs | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/01_core.js b/core/01_core.js index a8bdeb2a8..7663db5d9 100644 --- a/core/01_core.js +++ b/core/01_core.js @@ -453,7 +453,6 @@ BadResourcePrototype, Interrupted, InterruptedPrototype, - enableOpCallTracing, isOpCallTracingEnabled, opCallTraces, refOp, @@ -507,8 +506,11 @@ }); ObjectAssign(globalThis.__bootstrap, { core }); - const internals = {}; - ObjectAssign(globalThis.__bootstrap, { internals }); + ObjectAssign(globalThis.__bootstrap, { + internals: { + enableOpCallTracing, + }, + }); ObjectAssign(globalThis.Deno, { core }); // Direct bindings on `globalThis` diff --git a/core/runtime.rs b/core/runtime.rs index bae6a40db..6820df6bc 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -479,6 +479,26 @@ impl JsRuntime { } } } + // Cache bust plain JS (non-ES modules as well) + #[cfg(feature = "include_js_files_for_snapshotting")] + if snapshot_options != snapshot_util::SnapshotOptions::None { + let js_sources = options + .extensions + .iter() + .flat_map(|ext| match ext.get_js_sources() { + Some(s) => s.to_owned(), + None => vec![], + }) + .collect::>(); + for source in js_sources { + use crate::ExtensionFileSourceCode; + if let ExtensionFileSourceCode::LoadedFromFsDuringSnapshot(path) = + &source.code + { + println!("cargo:rerun-if-changed={}", path.display()) + } + } + } Rc::new(crate::modules::ExtModuleLoader::new( options.module_loader, -- cgit v1.2.3