A variable with the same name as one in a parent scope doesn't get defined in its local scope, only when it doesn't exist anywhere else.
Easy fix: at compile-time, save a list of locals in the func prototype. At func instantiation, force-declare all locals before running. Removes the need for expected vars count.
A variable with the same name as one in a parent scope doesn't get defined in its local scope, only when it doesn't exist anywhere else.
Easy fix: at compile-time, save a list of locals in the func prototype. At func instantiation, force-declare all locals before running. Removes the need for expected vars count.