summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 05:54:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 05:54:47 +0800
commit4876ff34f6c7ab8c234577ebf5f8a96d867b4f31 (patch)
treecaa0b030c07b32df590c3ea6d8c32052041f04ce /script/vm/compiler.lua
parentf8551a93927ab782ddd58397f86580dc6301a4be (diff)
downloadlua-language-server-4876ff34f6c7ab8c234577ebf5f8a96d867b4f31.zip
check nils
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index d764c91d..32cc7128 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -980,7 +980,7 @@ local compilerSwitch = util.switch()
for _, doc in ipairs(src.bindDocs) do
if doc.type == 'doc.type' then
vm.setNode(src, vm.compileNode(doc), true)
- return
+ return vm.getNode(src)
end
end
end
@@ -1773,6 +1773,7 @@ local function compileByGlobal(source)
vm.setNode(source, globalNode, true)
return
end
+ ---@type vm.node
globalNode = vm.createNode(global)
vm.setNode(root._globalBase[name], globalNode, true)
vm.setNode(source, globalNode, true)