Plain assert does not currently pass it's arguments on.
I found out while trying to use a library that uses assert internally:
Eg, the code below exhibits the problem:
function foo()
if something then
return nil , "error message"
else
return "abc" , "xyz"
end
end
local x1, x2 = assert ( foo() ) -- With luassert x2 is nil.
Plain assert does not currently pass it's arguments on.
I found out while trying to use a library that uses assert internally: Eg, the code below exhibits the problem:
Fix requires rewriting the function at https://github.com/Olivine-Labs/luassert/blob/2faa83264eb0439bd2772d80bfd4ce8198986105/src/assert.lua#L155