Fix no_function build.
This commit is contained in:
parent
4356d02828
commit
29bf790286
@ -295,6 +295,7 @@ impl Module {
|
||||
}
|
||||
|
||||
/// Get a script-defined function in the module based on name and number of parameters.
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
pub fn get_script_fn(
|
||||
&self,
|
||||
name: &str,
|
||||
|
@ -605,8 +605,10 @@ fn optimize_expr(expr: Expr, state: &mut State) -> Expr {
|
||||
let ((name, _, _, pos), _, _, args, def_value) = x.as_mut();
|
||||
|
||||
// First search for script-defined functions (can override built-in)
|
||||
let has_script_fn = cfg!(not(feature = "no_function"))
|
||||
&& state.lib.get_script_fn(name, args.len(), false).is_some();
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
let has_script_fn = state.lib.get_script_fn(name, args.len(), false).is_some();
|
||||
#[cfg(feature = "no_function")]
|
||||
let has_script_fn = false;
|
||||
|
||||
if !has_script_fn {
|
||||
let mut arg_values: StaticVec<_> = args.iter().map(Expr::get_constant_value).collect();
|
||||
|
Loading…
Reference in New Issue
Block a user