From 3ce99b2c6e11b2a491d43241a003b0b8f72f4599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olari=20T=C5=A1ernobrovkin?= Date: Tue, 7 Jul 2026 18:27:10 +0300 Subject: [PATCH] Attempt to fix tests (reimplement get_children) --- src/graph.luau | 9 +++++++++ test/tests.luau | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/graph.luau b/src/graph.luau index 2fa9346..4bfeb65 100644 --- a/src/graph.luau +++ b/src/graph.luau @@ -279,6 +279,14 @@ local function create_source_node(value: T): SourceNode return { cache = value, children = {} } end +local function get_children_as_array(node: Node): { Node } + local arr = {} + for child, _ in node.children do + table.insert(arr, child) + end + return arr +end + local function set_context(node: Node, key: number, value: unknown) if node.context then node.context[key] = value @@ -301,6 +309,7 @@ return table.freeze { push_child = push_child, create_node = create_node, create_source_node = create_source_node, + get_children_as_array = get_children_as_array, flush_update_queue = flush_update_queue, get_update_queue_length = get_update_queue_length, set_context = set_context, diff --git a/test/tests.luau b/test/tests.luau index af6a7f4..fc95580 100644 --- a/test/tests.luau +++ b/test/tests.luau @@ -61,7 +61,7 @@ TEST("graph", function() local get_scope = graph.get_scope local push_scope = graph.push_scope local pop_scope = graph.pop_scope - local get_children = graph.get_children + local get_children = graph.get_children_as_array local push_cleanup = graph.push_cleanup local destroy = graph.destroy