mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Add check for recursive capturing
This commit is contained in:
parent
fd323d7d39
commit
f39774082a
1 changed files with 2 additions and 0 deletions
|
|
@ -119,6 +119,8 @@ end
|
||||||
|
|
||||||
-- detect what nodes were referenced in the given callback and returns them in an array
|
-- detect what nodes were referenced in the given callback and returns them in an array
|
||||||
local function capture<T, U>(fn: (U?) -> T, arg: U?): ({ Node<unknown> }, T)
|
local function capture<T, U>(fn: (U?) -> T, arg: U?): ({ Node<unknown> }, T)
|
||||||
|
if reff then throw("recursive capture detected") end
|
||||||
|
|
||||||
if flags.strict then check_for_yield(fn, arg) end
|
if flags.strict then check_for_yield(fn, arg) end
|
||||||
|
|
||||||
table.clear(refs)
|
table.clear(refs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue