Files
plainleaf/client/space_lua/stdlib
Matouš Jan Fialka 8cecd0985c [Space Lua] tostring() respects __tostring metamethod with live stack frame
`tostring()` was delegating to `luaToString()` which calls `__tostring`
with a dead stack frame, breaking metamethods that call back into
globals. Now `tostringFunction` receives the live stack frame, looks up
`__tostring` via `rawGet`, calls it through `luaCall` with the live
frame, and validates the return is a string.

Also add tests covering the basic case, the nested-call case, and the
error path for a non-string return.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-02-20 07:59:16 +01:00
..
2025-11-07 10:49:13 +01:00
2025-11-07 10:49:13 +01:00
2026-02-13 20:05:08 +01:00
2026-02-13 20:05:08 +01:00