local extFunc = {
add = function(tb, arg2)
print(tb)
print(arg2)
end
}
local a = {
__tostring = function(tb)
return "a"
end
}
local b = {
__mode = "kv",
__index = function(tb, key)
print(tb)
return extFunc[key]
end,
__newindex = function(tb, key, value)
print(tb)
print(key)
print(value)
end,
__call = function(tb, args)
print(tb)
print(args)
end,
__tostring = function(tb)
return "b"
end
}
local c = setmetatable(a, b)
c:add(1)
c.hp = 100
c(33333333)
print(c)
b
testBind.lua:16
b
testBind.lua:3
1
testBind.lua:4
b
testBind.lua:20
hp
testBind.lua:21
100
testBind.lua:22
b
testBind.lua:25
33333333
testBind.lua:26
b
testBind.lua:37