fix(parse): build array String() without recursion

utils.generation_params converted nested arrays to strings recursively,
so a crafted file with a value nested about 900 arrays deep raised
RecursionError, where the browser parser returns a result. The join now
runs on an explicit stack. A JS-parity case with 900-deep values pins it.
This commit is contained in:
Vito Sansevero
2026-10-19 21:34:47 -07:00
parent 36564b4767
commit b0ca3ced5f
4 changed files with 64 additions and 1 deletions
+6
View File
@@ -176,6 +176,12 @@ class StaysBounded(unittest.TestCase):
self.assertEqual(result["negativePrompt"], "t")
class DeeplyNestedValues(unittest.TestCase):
def test_deeply_nested_values_do_not_exhaust_the_python_stack(self):
result = run("deeply-nested-values")
self.assertEqual(result["positivePrompt"], "nested neighbours")
class Placeholders(unittest.TestCase):
def test_blank_text_is_a_placeholder_and_zero_seed_is_kept(self):
result = run("blank-text-and-zero-seed")