Space Lua: <close> attribute, __close metamethod and extensive tests (#1791)

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
This commit is contained in:
Matouš Jan Fialka
2026-01-28 09:05:23 +01:00
committed by GitHub
parent 4704f0d513
commit 9419cdcd9b
10 changed files with 2900 additions and 536 deletions
+2 -2
View File
@@ -41,10 +41,10 @@ async function runAndCatch(code: string, ref = "const_attribute.lua") {
Deno.test("const: Unknown attribute (parse-time)", () => {
let threw = false;
try {
parse(`local x<close> = 1`, { ref: "unknown_attribute.lua" });
parse(`local x<nope> = 1`, { ref: "unknown_attribute.lua" });
} catch (e: any) {
threw = true;
assertStringIncludes(String(e?.message ?? e), "unknown attribute 'close'");
assertStringIncludes(String(e?.message ?? e), "unknown attribute 'nope'");
}
if (!threw) {
throw new Error("Expected parse error for unknown attribute");