__index
Definition
-- @/lua/common/luaBinding.lua:43
function __luaBindIndexStatic(t, k)
local mt = getmetatable(t)
-- log('E', '', ' __index invoked on ' .. tostring(mt.___type))
local res = rawget(mt, k)
if res ~= nil then return res end
local origgetters = rawget(mt, 1) -- 1 = getters
local getFunc = rawget(origgetters or {}, k)
if getFunc ~= nil then
-- log('E', '', ' getter hit: ' .. tostring(k) .. ' = ' .. tostring(res))
if type(getFunc) == 'function' then
return getFunc()
else
return getFunc -- variables exposed through "addConstant()" return the value directly here (rather than a function)
end
end
local origmt = mt
while true do
mt = rawget(mt, 3) -- 3 = super
if not mt then
--log('E', '', string.format("property '%s.%s' is not found", origmt.___type, k))
return
end
res = rawget(mt, k)
if res ~= nil then
rawset(origmt, k, res)
return res
end
local getters = rawget(mt, 1) -- 1 = getters
if getters then
local getFunc = rawget(getters, k)
if type(getFunc) == 'function' then
-- log('E', '', ' getter hit: ' .. tostring(k) .. ' = ' .. tostring(res))
rawset(origgetters, k, getFunc)
return getFunc()
end
end
end
end
Callers
@/lua/ge/ge_utils.lua
scenetree.__index = function(class_table, memberName)
--log('E', logTag,'scenetree.__index('..tostring(class_table) .. ', ' .. tostring(memberName)..')')
--dump(class_table)
@/lua/common/libs/LuaIRC/init.lua
local meta_preconnect = {}
function meta_preconnect.__index(o, k)
local v = rawget(meta_preconnect, k)
@/lua/common/libs/LuLPeg/lulpeg.lua
local struct, boolset_constructor = {v={}}
function byteset_mt.__index(s,i)
if i == nil or i > s.upper then return nil end
Builder.proxymt = pattmt
function pattmt:__index(k)
return proxycache[self][k]