[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: globals (was Re: One more item to the collection of Lua hate-speech)
- From: Mark Hamburg <mark@...>
- Date: Fri, 2 Jul 2010 07:22:06 -0700
The Lightroom approach is to simply run a "linter" over the byte code to look for access to local variables not on our white list.
What I haven't dug into yet is how easy this will be to adapt to the 5.2 work 3 model for environments. Presumably we need to look for field accesses on particular parameters or upvalues. What could be particularly interesting relative to 5.1 would be if it were easy to tell the difference between accesses to the chunk-level _ENV and accesses to a more local _ENV parameter or variable since that would then enable cases where we wanted to repurpose global access -- e.g., more sophisticated table construction.
Another interesting option for the import everything into locals first approach would be a way to undeclare _ENV in the source code so that accesses past a certain point would be flagged as errors.
Mark