summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/_preload.lua
blob: becc691c4ecff5751b6c88eb76b4d8a8fe8d5ae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

-- _preload.lua

-- First thing executed when the plugin loads. Replaces the global environment (_G) with an empty table
-- with __index set to the old environment. This way any function or variable that is created globally by the plugin
-- won't be reported as new or undocumented.





local newEnv, oldEnv = {}, _G
local setmetatable = setmetatable
for k, v in pairs(_G) do
	newEnv[k] = v;
	oldEnv[k] = nil;
end
_G = setmetatable(oldEnv, {__index = newEnv});