From f39774082a9ef3692258d2b6587574a749932794 Mon Sep 17 00:00:00 2001 From: aaron <83140718+centau@users.noreply.github.com> Date: Mon, 28 Aug 2023 01:27:31 +0100 Subject: [PATCH] Add check for recursive capturing --- src/graph.luau | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/graph.luau b/src/graph.luau index 4da31a4..029067c 100644 --- a/src/graph.luau +++ b/src/graph.luau @@ -119,6 +119,8 @@ end -- detect what nodes were referenced in the given callback and returns them in an array local function capture(fn: (U?) -> T, arg: U?): ({ Node }, T) + if reff then throw("recursive capture detected") end + if flags.strict then check_for_yield(fn, arg) end table.clear(refs)