summaryrefslogtreecommitdiff
path: root/server/src/vm/value.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-15 16:51:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-15 16:51:16 +0800
commit53addf4379d9fc9d5ff23a8888022c4dcc6883f5 (patch)
treefe6c7fbb03edd4250607c2bbb7cfd5ab590ce055 /server/src/vm/value.lua
parent43e35b1a991f88407a4b560ee5f12138d83056b5 (diff)
downloadlua-language-server-53addf4379d9fc9d5ff23a8888022c4dcc6883f5.zip
修正一个bug
Diffstat (limited to 'server/src/vm/value.lua')
-rw-r--r--server/src/vm/value.lua25
1 files changed, 13 insertions, 12 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 4fa4b53b..a1ee897b 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -138,17 +138,7 @@ function mt:eachLibChild(callback)
end
end
-function mt:getChild(index, source)
- local value = self:_getChild(index)
- if not value then
- value = create('any', source)
- self:setChild(index, value)
- value.uri = self.uri
- end
- return value
-end
-
-function mt:_getChild(index, source, mark)
+local function finishGetChild(self, index, source, mark)
self:setType('table', 0.5)
local value = self:rawGet(index)
if value then
@@ -166,7 +156,18 @@ function mt:_getChild(index, source, mark)
return nil
end
mark[method] = true
- return method:_getChild(index, source, mark)
+
+ return finishGetChild(method, index, source, mark)
+end
+
+function mt:getChild(index, source)
+ local value = finishGetChild(self, index)
+ if not value then
+ value = create('any', source)
+ self:setChild(index, value)
+ value.uri = self.uri
+ end
+ return value
end
function mt:bindChild(other)