Make limit getters available without unchecked.
This commit is contained in:
@@ -36,6 +36,7 @@ pub struct GlobalRuntimeState<'a> {
|
||||
/// Number of operations performed.
|
||||
pub num_operations: u64,
|
||||
/// Number of modules loaded.
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
pub num_modules_loaded: usize,
|
||||
/// Level of the current scope.
|
||||
///
|
||||
|
@@ -738,7 +738,7 @@ impl Engine {
|
||||
|
||||
#[cfg(feature = "no_object")]
|
||||
_ => {
|
||||
err.take_position();
|
||||
let _ = err.take_position();
|
||||
err.to_string().into()
|
||||
}
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
@@ -924,7 +924,6 @@ impl Engine {
|
||||
let (expr, export) = &**x;
|
||||
|
||||
// Guard against too many modules
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
if global.num_modules_loaded >= self.max_modules() {
|
||||
return Err(ERR::ErrorTooManyModules(*_pos).into());
|
||||
}
|
||||
|
Reference in New Issue
Block a user