Don't hang on using luaToString on recursive data structures

This commit is contained in:
Zef Hemel
2025-01-17 18:30:29 +01:00
parent 83550c1623
commit ae20b81126
2 changed files with 21 additions and 6 deletions
+4
View File
@@ -50,4 +50,8 @@ Deno.test("Test Lua Rutime", async () => {
assertEquals(await luaToString([{ a: 1 }]), "{{a = 1}}");
// Ensure simple cases are not returning promises
assertEquals(luaToString(10), "10");
// Test circular references
const circular: any = {};
circular.self = circular;
assertEquals(await luaToString(circular), "{self = <circular reference>}");
});