mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
error report on sharedata newindex
This commit is contained in:
@@ -71,6 +71,10 @@ local function getcobj(self)
|
|||||||
return obj
|
return obj
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function meta:__newindex(key, value)
|
||||||
|
error ("Error newindex, the key [" .. genkey(self) .. "]")
|
||||||
|
end
|
||||||
|
|
||||||
function meta:__index(key)
|
function meta:__index(key)
|
||||||
local obj = getcobj(self)
|
local obj = getcobj(self)
|
||||||
local v = index(obj, key)
|
local v = index(obj, key)
|
||||||
@@ -78,7 +82,7 @@ function meta:__index(key)
|
|||||||
local children = self.__cache
|
local children = self.__cache
|
||||||
if children == nil then
|
if children == nil then
|
||||||
children = {}
|
children = {}
|
||||||
self.__cache = children
|
rawset(self, "__cache", children)
|
||||||
end
|
end
|
||||||
local r = children[key]
|
local r = children[key]
|
||||||
if r then
|
if r then
|
||||||
|
|||||||
Reference in New Issue
Block a user