summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-05 10:27:47 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-05 10:27:47 +0100
commit4ed1b20ba06ca4a16cbf68b7a32ab16dfffa698a (patch)
treec78ef32d8fbb016e7602f48947821cb4c28140bd
parent7b0db2a989f71608f399ae93cf717031ffb0ff94 (diff)
downloadsupple-4ed1b20ba06ca4a16cbf68b7a32ab16dfffa698a.tar.gz
SANDBOX: Use the CAPI variants of ipairs,pairs,next for transparent proxy behaviour
-rw-r--r--lib/supple/sandbox.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/supple/sandbox.lua b/lib/supple/sandbox.lua
index 6a79348..ab1d87a 100644
--- a/lib/supple/sandbox.lua
+++ b/lib/supple/sandbox.lua
@@ -103,9 +103,12 @@ local function run()
-- Prepare a severely limited sandbox
local sandbox_globals = {
type = capi.type,
+ pairs = capi.pairs,
+ ipairs = capi.ipairs,
+ next = capi.next,
}
- for _, k in ipairs({ "table", "string", "pairs", "ipairs", "pcall",
+ for _, k in ipairs({ "table", "string", "pcall",
"xpcall", "unpack", "tostring", "tonumber", "math",
"coroutine", "select", "error", "assert" }) do
sandbox_globals[k] = _G[k]