Prefer Engine::disable_symbol to disable eval.
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
use crate::plugin::*;
|
||||
use crate::{def_package, Dynamic, EvalAltResult, ImmutableString};
|
||||
|
||||
def_package!(crate:EvalPackage:"Disable 'eval'.", lib, {
|
||||
combine_with_exported_module!(lib, "eval", eval_override);
|
||||
});
|
||||
|
||||
#[export_module]
|
||||
mod eval_override {
|
||||
#[rhai_fn(return_raw)]
|
||||
pub fn eval(_script: ImmutableString) -> Result<Dynamic, Box<EvalAltResult>> {
|
||||
Err("eval is evil!".into())
|
||||
}
|
||||
}
|
@@ -6,7 +6,6 @@ use crate::{Module, Shared, StaticVec};
|
||||
|
||||
pub(crate) mod arithmetic;
|
||||
mod array_basic;
|
||||
mod eval;
|
||||
mod fn_basic;
|
||||
mod iter_basic;
|
||||
mod logic;
|
||||
@@ -21,7 +20,6 @@ mod time_basic;
|
||||
pub use arithmetic::ArithmeticPackage;
|
||||
#[cfg(not(feature = "no_index"))]
|
||||
pub use array_basic::BasicArrayPackage;
|
||||
pub use eval::EvalPackage;
|
||||
pub use fn_basic::BasicFnPackage;
|
||||
pub use iter_basic::BasicIteratorPackage;
|
||||
pub use logic::LogicPackage;
|
||||
|
Reference in New Issue
Block a user