summaryrefslogtreecommitdiff
path: root/script/vm/local-id.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-05 05:56:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-05 05:56:03 +0800
commit0e159ee03730b74c284c5ad079215b31461d266e (patch)
tree9fd2d7aef9903d9c9c2d07749ea9f1175b0eee77 /script/vm/local-id.lua
parent9310038417408a5c2f6c148447d951f248fce2fe (diff)
downloadlua-language-server-0e159ee03730b74c284c5ad079215b31461d266e.zip
update
Diffstat (limited to 'script/vm/local-id.lua')
-rw-r--r--script/vm/local-id.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/script/vm/local-id.lua b/script/vm/local-id.lua
index 06e086c7..b7a6e6d5 100644
--- a/script/vm/local-id.lua
+++ b/script/vm/local-id.lua
@@ -33,7 +33,11 @@ local compileSwitch = util.switch()
if not parentID then
return
end
- source._localID = parentID .. m.ID_SPLITE .. guide.getKeyName(source)
+ local key = guide.getKeyName(source)
+ if type(key) ~= 'string' then
+ return
+ end
+ source._localID = parentID .. m.ID_SPLITE .. key
source.field._localID = source._localID
if source.type == 'getfield' then
m.compileLocalID(source.next)
@@ -46,7 +50,11 @@ local compileSwitch = util.switch()
if not parentID then
return
end
- source._localID = parentID .. m.ID_SPLITE .. guide.getKeyName(source)
+ local key = guide.getKeyName(source)
+ if type(key) ~= 'string' then
+ return
+ end
+ source._localID = parentID .. m.ID_SPLITE .. key
source.method._localID = source._localID
if source.type == 'getmethod' then
m.compileLocalID(source.next)
@@ -60,7 +68,7 @@ local compileSwitch = util.switch()
return
end
local key = guide.getKeyName(source)
- if not type(key) ~= 'string' then
+ if type(key) ~= 'string' then
return
end
source._localID = parentID .. m.ID_SPLITE .. key