summaryrefslogtreecommitdiff
path: root/server/src/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-21 11:32:50 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-21 11:32:50 +0800
commit2ceb00e76cbb14f4e1b742cad3852a89c0417684 (patch)
tree28c17ed5d12f49de4d870ae44d6676c627f07ef8 /server/src/vm
parent251618f05b73bb5607252ee16760b64e5249a0a3 (diff)
downloadlua-language-server-2ceb00e76cbb14f4e1b742cad3852a89c0417684.zip
改成检测
Diffstat (limited to 'server/src/vm')
-rw-r--r--server/src/vm/value.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 9fd1fdf1..c9e833d6 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -124,6 +124,10 @@ 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