diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-11 16:00:11 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-11 16:00:11 +0800 |
commit | a8b970238486c28868d3199cd8bba2d07a421817 (patch) | |
tree | e0c621760f6265317f3e70ba54c97ae5f6db0410 /server-beta/src/core/local.lua | |
parent | a54939cb662f8730a011cababf37b634e6344300 (diff) | |
download | lua-language-server-a8b970238486c28868d3199cd8bba2d07a421817.zip |
更新
Diffstat (limited to 'server-beta/src/core/local.lua')
-rw-r--r-- | server-beta/src/core/local.lua | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/server-beta/src/core/local.lua b/server-beta/src/core/local.lua index adbb9138..0ad53e87 100644 --- a/server-beta/src/core/local.lua +++ b/server-beta/src/core/local.lua @@ -93,30 +93,32 @@ function m:field(source, key, callback) end elseif name == 'setmetatable' then local t, mt = self:callArgOf(call) - self:eachField(mt, 's|__index', function (src, mode) - if mode == 'set' then - -- t.field -> mt.__index.field - if used[t] then - self:eachValue(src, function (mtvalue) - self:eachField(mtvalue, key, callback) - end) - end - -- mt.__index.field -> t.field - self:eachDef(src, function (src) - if used[src] then - self:eachValue(t, function (mtvalue) + if mt then + self:eachField(mt, 's|__index', function (src, mode) + if mode == 'set' then + -- t.field -> mt.__index.field + if used[t] then + self:eachValue(src, function (mtvalue) self:eachField(mtvalue, key, callback) end) - local obj = self:callReturnOf(call) - if obj then - self:eachValue(obj, function (mtvalue) + end + -- mt.__index.field -> t.field + self:eachDef(src, function (src) + if used[src] then + self:eachValue(t, function (mtvalue) self:eachField(mtvalue, key, callback) end) + local obj = self:callReturnOf(call) + if obj then + self:eachValue(obj, function (mtvalue) + self:eachField(mtvalue, key, callback) + end) + end end - end - end) - end - end) + end) + end + end) + end end end) end |