Add Engine::module_resolver.

This commit is contained in:
Stephen Chung 2022-08-25 22:25:41 +08:00
parent 5c80157e7a
commit b36f746dbe
2 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,7 @@ Enhancements
* `is_empty` method is added to arrays, BLOB's, object maps, strings and ranges. * `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. * `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 Version 1.9.0

View File

@ -70,6 +70,15 @@ pub mod default_limits {
} }
impl Engine { 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`]. /// Set the module resolution service used by the [`Engine`].
/// ///
/// Not available under `no_module`. /// Not available under `no_module`.