Fix internals build.

This commit is contained in:
Stephen Chung 2021-01-09 00:49:50 +08:00
parent bfe9ac2188
commit 1513e6ab6a
2 changed files with 6 additions and 5 deletions

View File

@ -280,8 +280,9 @@ impl AST {
}
/// Get the embedded [module resolver][`ModuleResolver`].
#[cfg(not(feature = "no_module"))]
#[cfg(not(feature = "internals"))]
#[inline(always)]
pub(crate) fn shared_resolver(
pub(crate) fn resolver(
&self,
) -> Option<Shared<crate::module::resolvers::StaticModuleResolver>> {
self.resolver.clone()
@ -291,8 +292,8 @@ impl AST {
#[cfg(not(feature = "no_module"))]
#[cfg(feature = "internals")]
#[inline(always)]
pub fn resolver(&self) -> Option<&dyn crate::ModuleResolver> {
self.resolver.map(|r| &*r)
pub fn resolver(&self) -> Option<Shared<crate::module::resolvers::StaticModuleResolver>> {
self.resolver.clone()
}
/// Set the embedded [module resolver][`ModuleResolver`].
#[cfg(not(feature = "no_module"))]

View File

@ -1520,7 +1520,7 @@ impl Engine {
let state = &mut State {
source: ast.clone_source(),
#[cfg(not(feature = "no_module"))]
resolver: ast.shared_resolver(),
resolver: ast.resolver(),
..Default::default()
};
self.eval_statements_raw(scope, mods, state, ast.statements(), &[ast.lib()], level)
@ -1589,7 +1589,7 @@ impl Engine {
let state = &mut State {
source: ast.clone_source(),
#[cfg(not(feature = "no_module"))]
resolver: ast.shared_resolver(),
resolver: ast.resolver(),
..Default::default()
};
self.eval_statements_raw(scope, mods, state, ast.statements(), &[ast.lib()], 0)?;