Share environment when making module from AST.

This commit is contained in:
Stephen Chung
2020-11-19 10:52:45 +08:00
parent 1de85d749d
commit 0e4743e7c7
2 changed files with 7 additions and 3 deletions

View File

@@ -150,6 +150,12 @@ impl AST {
pub(crate) fn statements_mut(&mut self) -> &mut Vec<Stmt> {
&mut self.0
}
/// Get the internal shared `Module` containing all script-defined functions.
#[cfg(not(feature = "internals"))]
#[inline(always)]
pub(crate) fn shared_lib(&self) -> Shared<Module> {
self.1.clone()
}
/// Get the internal `Module` containing all script-defined functions.
#[cfg(not(feature = "internals"))]
#[inline(always)]