[Space Lua] Fix: t[nil] read returns nil, not an error

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
This commit is contained in:
Matouš Jan Fialka
2026-02-20 15:06:22 +01:00
parent 91927a7314
commit c3b747b0d5
4 changed files with 12 additions and 23 deletions
-12
View File
@@ -45,18 +45,6 @@ Deno.test("Context error: indexing nil value includes message and ref", async ()
assertCtxErrorContains(e, code, ref, "attempt to index a nil value");
});
Deno.test("Context error: indexing with nil key includes message and ref", async () => {
const { e, code, ref } = await runAndCatch(
`
local t = {}
local k = nil
local x = t[k]
`,
"nil_key.lua",
);
assertCtxErrorContains(e, code, ref, "attempt to index with a nil key");
});
Deno.test("Context error: calling nil includes message and ref", async () => {
const { e, code, ref } = await runAndCatch(
`