diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 20:45:23 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 20:45:23 +0800 |
commit | 317bced17780ebdeed67ed17590b7e2598b2b55a (patch) | |
tree | faa924c96bfbe9305434de0ca70e6649fd0d8113 /script/vm/node.lua | |
parent | bb1244fa62c0158490d2e54da0a19f28f16fe994 (diff) | |
download | lua-language-server-317bced17780ebdeed67ed17590b7e2598b2b55a.zip |
update
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r-- | script/vm/node.lua | 13 |
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 |