@/lua/common/luaBinding.lua
-- 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, k)
local origgetters = rawget(mt, 1) -- 1 = getters
local getFunc = rawget(origgetters, k)
if getFunc ~= nil then
while true do
mt = rawget(mt, 3) -- 3 = super
if not mt then
end
res = rawget(mt, k)
if res ~= nil then
end
local getters = rawget(mt, 1) -- 1 = getters
if getters then
if getters then
local getFunc = rawget(getters, k)
if type(getFunc) == 'function' then
-- 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)
local origgetters = rawget(mt, 1) -- 1 = getters
local getFunc = rawget(origgetters or {}, k)
if getFunc ~= nil then
while true do
mt = rawget(mt, 3) -- 3 = super
if not mt then
end
res = rawget(mt, k)
if res ~= nil then
end
local getters = rawget(mt, 1) -- 1 = getters
if getters then
if getters then
local getFunc = rawget(getters, k)
if type(getFunc) == 'function' then
--log('E', '', '__newindex invoked on ' .. tostring(mt.___type))
local origsetters = rawget(mt, 2) -- 2 = setters
local setFunc = rawget(origsetters, k)
local origsetters = rawget(mt, 2) -- 2 = setters
local setFunc = rawget(origsetters, k)
if setFunc ~= nil then
while true do
mt = rawget(mt, 3) -- 3 = super
if not mt then
end
local setters = rawget(mt, 2) -- 2 = setters
if setters then
if setters then
local setFunc = rawget(setters, k)
if type(setFunc) == 'function' then
local mt = getmetatable(t)
local origsetters = rawget(mt, 2) -- 2 = setters
local setFunc = rawget(origsetters, k)
local origsetters = rawget(mt, 2) -- 2 = setters
local setFunc = rawget(origsetters, k)
if setFunc ~= nil then
while true do
mt = rawget(mt, 3) -- 3 = super
if not mt then
end
local setters = rawget(mt, 2) -- 2 = setters
if setters then
if setters then
local setFunc = rawget(setters, k)
if type(setFunc) == 'function' then
local res = rawget(mt, k)
if res ~= nil then return res end
local getFunc = rawget(rawget(mt, 1), k) -- 1 = getters
if getFunc ~= nil then return getFunc(obj) end
local getFunc = rawget(rawget(mt, 1), k) -- 1 = getters
if getFunc ~= nil then return getFunc(obj) end
-- getStaticDataFieldbyName, getDynDataFieldbyName
local dynField = rawget(mt, 4)(obj, k, 0) or rawget(mt, 5)(obj, k, 0)
if dynField ~= nil then return dynField end
-- getStaticDataFieldbyName, getDynDataFieldbyName
local dynField = rawget(mt, 4)(obj, k, 0) or rawget(mt, 5)(obj, k, 0)
if dynField ~= nil then return dynField end
local mt = getmetatable(obj)
local setFunc = rawget(rawget(mt, 2), k) -- 2 = setters
if setFunc ~= nil then
local mt = getmetatable(obj)
local setFunc = rawget(rawget(mt, 2), k) -- 2 = setters
if setFunc ~= nil then
if rawget(mt, 6)(obj, k, 0, v) then return end -- setStaticDataFieldbyName
if rawget(mt, 7)(obj, k, 0, v) then return end -- setDynDataFieldbyName
if rawget(mt, 6)(obj, k, 0, v) then return end -- setStaticDataFieldbyName
if rawget(mt, 7)(obj, k, 0, v) then return end -- setDynDataFieldbyName
end
local workmt = mt
local workgetters = rawget(workmt, 1) or {}
rawset(workmt, 1, workgetters)
local worksetters = rawget(workmt, 2) or {}
rawset(workmt, 2, worksetters)
rawset(workmt, 2, worksetters)
mt = rawget(mt, 3)
while mt ~= nil do
while mt ~= nil do
for k, v in pairs(rawget(mt, 1)) do
workgetters[k] = workgetters[k] or v
for k, v in pairs(rawget(mt, 2)) do
worksetters[k] = worksetters[k] or v
if type(k) == "string" then
rawset(workmt, k, rawget(workmt, k) or v)
end
end
mt = rawget(mt, 3)
end
-- create simobject metatable
rawset(rawget(classtable, 1), "className", classtable.getClassName)
if next(rawget(classtable, 2)) == nil and rawget(classtable, 3) == nil then
rawset(rawget(classtable, 1), "className", classtable.getClassName)
if next(rawget(classtable, 2)) == nil and rawget(classtable, 3) == nil then
rawset(rawget(classtable, 2), 1, 0) -- disable newindex optimization when newindex table is empty
rawset(rawget(classtable, 1), "className", classtable.getClassName)
if next(rawget(classtable, 2)) == nil and rawget(classtable, 3) == nil then
rawset(rawget(classtable, 2), 1, 0) -- disable newindex optimization when newindex table is empty
if next(rawget(classtable, 2)) == nil and rawget(classtable, 3) == nil then
rawset(rawget(classtable, 2), 1, 0) -- disable newindex optimization when newindex table is empty
end
-- optimize metatables
if rawget(v, 3) == nil then -- no super
if next(rawget(v, 2)) == nil then -- no setters
if rawget(v, 3) == nil then -- no super
if next(rawget(v, 2)) == nil then -- no setters
rawset(v, 2, nil)
if next(rawget(v, 1)) == nil and rawget(v, '__index') ~= rawget(v, 1) then -- no getters
local plainGetters = rawget(v, 1)
if next(rawget(v, 1)) == nil and rawget(v, '__index') ~= rawget(v, 1) then -- no getters
local plainGetters = rawget(v, 1)
if next(rawget(v, 1)) == nil and rawget(v, '__index') ~= rawget(v, 1) then -- no getters
local plainGetters = rawget(v, 1)
if next(rawget(v, 1)) == nil and rawget(v, '__index') ~= rawget(v, 1) then -- no getters
local plainGetters = rawget(v, 1)
if rawget(v, '__newindex') == nil then
local plainGetters = rawget(v, 1)
if rawget(v, '__newindex') == nil then
for f, getter in pairs(v) do