Fix getting caller information from Lua::load

This commit is contained in:
Alex Orlenko 2022-10-28 10:43:05 +01:00
parent e98998d6ac
commit e1bbd00a33
No known key found for this signature in database
GPG key ID: 4C150C250863B96D

View file

@ -1371,9 +1371,8 @@ impl Lua {
where
S: AsChunk<'lua> + ?Sized,
{
let name = chunk
.name()
.unwrap_or_else(|| Location::caller().to_string());
let caller = Location::caller();
let name = chunk.name().unwrap_or_else(|| caller.to_string());
Chunk {
lua: self,