[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Determining if _ENV is the first upvalue of a closure?
- From: Tim Hill <drtimhill@...>
- Date: Fri, 13 Mar 2015 10:39:43 -0700
> On Mar 13, 2015, at 5:00 AM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
>
> But I'm sure you know all this and I'm not answering your question.
>
> I think the only real solution is to avoid stripping debug information
> and search the upvalue list for an upvalue named _ENV.
>
> If you can change the app, then perhaps you can add a special entry
> in environments (both the global one and custom ones) and look in
> the list of upvalues to see if they are a table with that entry.
> This would then work even after stripping debug information.
>
Thanks for the info and yes I’d figured out the details of _ENV but it was good to have it confirmed. I’d pretty much come to the same conclusion; that I will have to enforce a “decoration” on the environment tables so that they can be identified (I cannot rely on not stripping debug info sadly).
Thanks for the help!
—Tim