Skip to content

matthewdean/proxy.lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 

Repository files navigation

proxy.lua

Control access to Lua objects.

local proxy = require('proxy').new()

proxy:override('__index', function(t, k)
  print('indexing ', t, 'at', k)
  return t[k]
end)

-- calling proxy() wraps the given object and returns a proxy object
_G = proxy(_G)
print(_G._VERSION)

You can also override specific values:

proxy:override(loadstring, nil)
print(loadstring) --> nil

About

Control access to objects in pure Lua

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages