Eliminate script hashes under no_function.

This commit is contained in:
Stephen Chung
2021-11-16 13:42:46 +08:00
parent b178d7c367
commit e961ae23fd
5 changed files with 48 additions and 29 deletions

View File

@@ -239,12 +239,13 @@ impl<'a> NativeCallContext<'a> {
args: &mut [&mut Dynamic],
) -> Result<Dynamic, Box<EvalAltResult>> {
let hash = if is_method_call {
FnCallHashes::from_script_and_native(
FnCallHashes::from_all(
#[cfg(not(feature = "no_function"))]
calc_fn_hash(fn_name, args.len() - 1),
calc_fn_hash(fn_name, args.len()),
)
} else {
FnCallHashes::from_script(calc_fn_hash(fn_name, args.len()))
calc_fn_hash(fn_name, args.len()).into()
};
self.engine()