summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-21 20:45:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-21 20:45:23 +0800
commit317bced17780ebdeed67ed17590b7e2598b2b55a (patch)
treefaa924c96bfbe9305434de0ca70e6649fd0d8113 /script/vm/node.lua
parentbb1244fa62c0158490d2e54da0a19f28f16fe994 (diff)
downloadlua-language-server-317bced17780ebdeed67ed17590b7e2598b2b55a.zip
update
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r--script/vm/node.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index 9433733e..61781e5f 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -252,6 +252,17 @@ function mt:narrow(name)
return self
end
+---@param obj vm.object
+function mt:removeObject(obj)
+ for index, c in ipairs(self) do
+ if c == obj then
+ table.remove(self, index)
+ self[c] = nil
+ return
+ end
+ end
+end
+
---@param node vm.node
function mt:removeNode(node)
for _, c in ipairs(node) do
@@ -265,6 +276,8 @@ function mt:removeNode(node)
else
self:remove 'false'
end
+ else
+ self:removeObject(c)
end
end
end