lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Nov 20, 2013 at 04:17:26AM +0000, Sir Pogsalot wrote:
> _ENV = setmetatable(new_env, { __index = _ENV, __newindex = _ENV })

This should probably be

  local _ENV = setmetatable(new_env, { __index = _ENV, __newindex = _ENV })

otherwise you are mucking with the _ENV used by earlier code in the chunk,
which may lead to unexpected behavior. But it may also be intentional. I
dunno.