From b28f9445aae85dbf86033300cfcb55e404529a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 28 Apr 2021 18:28:46 +0200 Subject: refactor(core): simplify module loading code (#10385) General cleanup of module loading code, tried to reduce indentation in various methods on "JsRuntime" to improve readability. Added "JsRuntime::handle_scope" helper function, which returns a "v8::HandleScope". This was done to reduce a code pattern that happens all over the "deno_core". Additionally if event loop hangs during loading of dynamic modules a list of currently pending dynamic imports is printed. --- core/modules.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/modules.rs') diff --git a/core/modules.rs b/core/modules.rs index 8c193bf5b..b68d19def 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -495,6 +495,10 @@ impl ModuleMap { None } + + pub fn get_info_by_id(&self, id: &ModuleId) -> Option<&ModuleInfo> { + self.info.get(id) + } } #[cfg(test)] -- cgit v1.2.3