4. If you compile a function using `load` or `loadstring`, its _ENV is one of:
a. An _ENV parameter.
b. The _ENV specified in the `load`.
c. An _ENV upvalue.
I think it’s always either the distinguished environment (the one stored in the registry at a well-known key) or the explicit table specified as an argument to load().
—Tim