aboutsummaryrefslogtreecommitdiff
path: root/src/jthread/win32
diff options
context:
space:
mode:
authorSebastian Rühl <bahamada_basti@yahoo.de>2011-06-26 12:52:03 +0200
committerSebastian Rühl <bahamada_basti@yahoo.de>2011-06-26 12:52:03 +0200
commitfb6ac9a1a6b68e87665a9e1692295230ebcef8db (patch)
treeb3113be104d0f64b42a0417d02ba66049ce80f8c /src/jthread/win32
parent033ae0dcaecc37fee487e44896a0c0fb4c844e4e (diff)
downloadminetest-fb6ac9a1a6b68e87665a9e1692295230ebcef8db.tar.gz
minetest-fb6ac9a1a6b68e87665a9e1692295230ebcef8db.tar.bz2
minetest-fb6ac9a1a6b68e87665a9e1692295230ebcef8db.zip
small fix
Diffstat (limited to 'src/jthread/win32')
0 files changed, 0 insertions, 0 deletions
kwd">__newindex(name, value) local info = getinfo(2, "Sl") local desc = ("%s:%d"):format(info.short_src, info.currentline) if not declared[name] then local warn_key = ("%s\0%d\0%s"):format(info.source, info.currentline, name) if not warned[warn_key] and info.what ~= "main" and info.what ~= "C" then core.log("warning", ("Assignment to undeclared ".. "global %q inside a function at %s.") :format(name, desc)) warned[warn_key] = true end declared[name] = true end -- Ignore mod namespaces if WARN_INIT and name ~= core.get_current_modname() then core.log("warning", ("Global variable %q created at %s.") :format(name, desc)) end rawset(self, name, value) end function meta:__index(name) local info = getinfo(2, "Sl") local warn_key = ("%s\0%d\0%s"):format(info.source, info.currentline, name) if not declared[name] and not warned[warn_key] and info.what ~= "C" then core.log("warning", ("Undeclared global variable %q accessed at %s:%s") :format(name, info.short_src, info.currentline)) warned[warn_key] = true end return rawget(self, name) end setmetatable(_G, meta)