How could this be written neater?
View Single Post
05-08-17, 07:00 AM
A Cobalt Mageweaver
Join Date: Aug 2011
Originally Posted by
The only reason why I do local _G = getfenv(0) is my paranoia o_O
I've seen addons that do some weird manipulations w/ environments, so _G may end up being something else, and a check like _G == getfenv(0) will return false.
IMHO, if you have no paranoia and don't call global functions from inside OnUpdate and prob OnEvent funcs, only if you register for REALLY spammy events, e.g., CLEU, there's no point in creating upvalues for pretty much anything.
Another reason might be to please one's Lua linter
Lmao @ please one's Lua linter! This is so true and has become a thing for me. I use Atom text editor and
so I guess I am just so used to pleasing it
Also never thought of the whole _G = getfenv(0) deal. Incoming paranoia?
Success isn't what you've done compared to others. Success is what you've done compared to what you were made to do.
View Public Profile
Send a private message to Kkthnx
Find More Posts by Kkthnx