[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What happens when you try to serialize a closure
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 25 Jan 2013 16:50:18 -0200
> I amended the example in the original question to make _ENV to be the
> first upvalue:
When in doubt, read the code:
http://www.lua.org/source/5.2/lapi.c.html#lua_load
It only sets the first upvalue if there is exactly one upvalue, which is
the case for main chunks. Again, this is what the manual promises: that
main chunks will be loaded with the correct _ENV.