From b75e596af61da88aa705491778a5fd6845ab43ba Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Mar 2015 17:35:10 +1000 Subject: Add internal reference for skang modules, so they can find themselves. --- lib/skang.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/skang.lua b/lib/skang.lua index e44d4bc..8de692e 100644 --- a/lib/skang.lua +++ b/lib/skang.lua @@ -117,6 +117,8 @@ moduleBegin = function (name, author, copyright, version, timestamp, skin, isLua end _M._M = _M -- So that references to _M below the setfenv() actually go to the real _M. + --[[ TODO - Check if it exists before doing this, or could override standard Lua stuff. ]] + _M[name] = _M -- So that the module can refer to itself internally. _M._NAME = name _M._PACKAGE = string.gsub(_M._NAME, "[^.]*$", "") -- Strip the name down to the package name. _M.isLua = isLua -- cgit v1.1