Add plugins test.

This commit is contained in:
Stephen Chung
2020-08-02 18:53:25 +08:00
parent 675c4eb606
commit 5eed5fe6a3
5 changed files with 35 additions and 23 deletions

View File

@@ -204,7 +204,11 @@ impl Engine {
}
// Run external function
let result = func.get_native_fn()(self, lib, args)?;
let result = if func.is_plugin_fn() {
func.get_plugin_fn().call(args, Position::none())?
} else {
func.get_native_fn()(self, lib, args)?
};
// Restore the original reference
restore_first_arg(old_this_ptr, args);