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`.