1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add strict module

Also fix leaking globals found by it.
This commit is contained in:
ShadowNinja 2014-06-05 12:40:34 -04:00
parent 6afdb22ba7
commit a6ba042cf7
4 changed files with 51 additions and 3 deletions

View file

@ -7,7 +7,7 @@
function core.string_to_privs(str, delim)
assert(type(str) == "string")
delim = delim or ','
privs = {}
local privs = {}
for _, priv in pairs(string.split(str, delim)) do
privs[priv:trim()] = true
end
@ -17,7 +17,7 @@ end
function core.privs_to_string(privs, delim)
assert(type(privs) == "table")
delim = delim or ','
list = {}
local list = {}
for priv, bool in pairs(privs) do
if bool then
table.insert(list, priv)