summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-14 19:52:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-14 19:52:28 +0800
commit045de450dd7a21e5db3b26dff39d5cd1dcf92c76 (patch)
treec9d07b61895c1a83ed669094c3aabd2d938524f0 /script/vm/node.lua
parent6347c005565027cb40c7b9ad70be6edb968dd30f (diff)
downloadlua-language-server-045de450dd7a21e5db3b26dff39d5cd1dcf92c76.zip
fix global
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r--script/vm/node.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index b43bea3a..ea6a5874 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -196,13 +196,16 @@ function mt:eachObject()
end
end
----@param source vm.object
+---@param source parser.object | vm.generic
---@param node vm.node | vm.object
---@param cover? boolean
function vm.setNode(source, node, cover)
if not node then
error('Can not set nil node')
end
+ if source.type == 'global' then
+ error('Can not set node to global')
+ end
if cover then
vm.nodeCache[source] = node
return