I have a very basic question, when are optimizations disabled when using getfenv exactly?
local myFunc = function() getfenv() end;
Would the above disable optimizations even when not called? And if not would this disable optimizations:
thread = thread or getfenv(2).thread; --Example
Even when I give the thread’s value? I know “or” never runs the second condition if the first one is true, but I do not know how roblox handles these optimizations exactly.
getfenv(), setfenv() and loadstring() perform dynamic deoptimizations of a function by marking its environment as impure, the deoptimization is performed during runtime not during compilation.