mirror of
https://github.com/kikito/lua-sandbox.git
synced 2024-12-18 03:04:20 +00:00
sandbox.protect() now returns as a second value the sandbox's environment
Returning the sandbox's environment to the sandbox caller gives flexibility to invoke functions defined in the caller's scope but using the sandbox's environment.
This commit is contained in:
parent
406161751b
commit
dd964ac2bb
@ -172,7 +172,7 @@ function sandbox.protect(code, options)
|
|||||||
if not t[1] then error(t[2]) end
|
if not t[1] then error(t[2]) end
|
||||||
|
|
||||||
return table.unpack(t, 2, t.n)
|
return table.unpack(t, 2, t.n)
|
||||||
end
|
end, env
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Public interface: sandbox.run
|
-- Public interface: sandbox.run
|
||||||
|
Loading…
Reference in New Issue
Block a user