diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-21 13:00:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-21 13:00:13 +0800 |
commit | 999f261b32d8e7433548c818039e38c83b3e2ef8 (patch) | |
tree | ac316d5ba60834e60fdeeea35a5c24b8fa0abdb2 | |
parent | 2ceb00e76cbb14f4e1b742cad3852a89c0417684 (diff) | |
download | lua-language-server-999f261b32d8e7433548c818039e38c83b3e2ef8.zip |
修正报错
-rw-r--r-- | server/src/vm/value.lua | 4 | ||||
-rw-r--r-- | server/src/vm/vm.lua | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index c9e833d6..9fd1fdf1 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -124,10 +124,6 @@ end function mt:setChild(index, value, source) self:setType('table', 0.5) - -- TODO 临时检测 - if type(index) == 'table' and index.type ~= 'value' then - error('child index must be a value', table.dump(index)) - end self:rawSet(index, value, source) return value end diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index df2cd234..469e9050 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -408,7 +408,8 @@ function mt:getIndex(source) child:set('in index', source) return child[1] else - return self:getExp(child) + local index = self:getExp(child) + return self:getFirstInMulti(index) end end |