[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] lglob 0.8 Extended Globals Checker for Lua
- From: Petite Abeille <petite.abeille@...>
- Date: Tue, 30 Apr 2013 01:24:42 +0200
On Apr 30, 2013, at 12:47 AM, Philipp Janda <siffiejoe@gmx.net> wrote:
> Am 29.04.2013 23:31 schröbte Petite Abeille:
>>
>> But… _ENV is not the global environment... _G is.
>
> To figure out which environment should be considered a "global" environment would require some convention like: only environments passed to one of the load* functions are global environments, or any environment that contains (most of) the Lua standard library is a global environment, or if there's a field _ENV._G that refers back to _ENV, then _ENV is considered a global environment.
Nah. _G is always at LUA_RIDX_GLOBALS. And that is that.
http://www.lua.org/manual/5.2/manual.html#2.2
http://www.lua.org/manual/5.2/manual.html#4.5
> But all this can only be checked at runtime anyway:
Most likely yes.
R.I.P. byte code analyzes for globals in 5.2. Oh, well...