From b36f746dbe1fe9c9e68d417327e86963b9794c76 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 25 Aug 2022 22:25:41 +0800 Subject: [PATCH] Add Engine::module_resolver. --- CHANGELOG.md | 1 + src/api/mod.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 421f305a..7f17154f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Enhancements * `is_empty` method is added to arrays, BLOB's, object maps, strings and ranges. * `StaticModuleResolver` now stores the path in the module's `id` field. +* `Engine::module_resolver` is added to grant access to the `Engine`'s module resolver. Version 1.9.0 diff --git a/src/api/mod.rs b/src/api/mod.rs index b5120787..7f128243 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -70,6 +70,15 @@ pub mod default_limits { } impl Engine { + /// The module resolution service used by the [`Engine`]. + /// + /// Not available under `no_module`. + #[cfg(not(feature = "no_module"))] + #[inline(always)] + pub fn module_resolver(&self) -> &dyn crate::ModuleResolver { + &*self.module_resolver + } + /// Set the module resolution service used by the [`Engine`]. /// /// Not available under `no_module`.