SHARE
TWEET

Minetest: globalchecker

kaeza Dec 14th, 2013 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ------------------------------------------------------------------------------
  2. ------------------------------------------------------------------------------
  3.  
  4. local mt = getmetatable(_G)
  5. if not mt then
  6.         mt = { }
  7.         setmetatable(_G, mt)
  8. end
  9.  
  10. function mt:__newindex(key, value)
  11.         local i = debug.getinfo(2)
  12.         print(("[globalchecker] new global %s at %s:%d"):format(key, i.source, i.currentline))
  13.         rawset(self, key, value)
  14. end
  15.  
  16. ------------------------------------------------------------------------------
  17. ------------------------------------------------------------------------------
RAW Paste Data
Top