Merge pull request #189 from hack3ric/master

`Function::bind`: simply clone the function if args are empty `MultiValue`
This commit is contained in:
Alex Orlenko 2022-07-22 00:28:18 +01:00 committed by GitHub
commit 4a25eab257
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -210,6 +210,10 @@ impl<'lua> Function<'lua> {
let args = args.to_lua_multi(lua)?;
let nargs = args.len() as c_int;
if nargs == 0 {
return Ok(self.clone());
}
if nargs + 1 > ffi::LUA_MAX_UPVALUES {
return Err(Error::BindError);
}