Allow Rust functions in FnPtr::call_dynamic.

This commit is contained in:
Stephen Chung
2020-07-27 12:52:32 +08:00
parent 2dd4d9bcf9
commit a3a167424b
9 changed files with 248 additions and 135 deletions

View File

@@ -125,8 +125,7 @@ engine.register_raw_fn(
let this_ptr = args.get_mut(0).unwrap(); // 1st argument - this pointer
// Use 'FnPtr::call_dynamic' to call the function pointer.
// Beware, only script-defined functions are supported by 'FnPtr::call_dynamic'.
// If it is a native Rust function, directly call it here in Rust instead!
// Beware, private script-defined functions will not be found.
fp.call_dynamic(engine, lib, Some(this_ptr), [value])
},
);