summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-12-15 21:09:14 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-12-15 21:09:14 +0800
commit6e2d3d42dba22ee9f179546b1e92d0b3313ec1f5 (patch)
tree3d32e12c94ca119167e84eb994d859d91c690785 /script/vm/node.lua
parenta744e3439e165be13f8f0ba5262b8f1efec0d86d (diff)
downloadlua-language-server-6e2d3d42dba22ee9f179546b1e92d0b3313ec1f5.zip
stash
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r--script/vm/node.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index d0fd5ffb..2e408128 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -188,6 +188,9 @@ end
---@return vm.node
function mt:setFalsy()
+ if self.optional == false then
+ self.optional = nil
+ end
local hasBoolean
for index = #self, 1, -1 do
local c = self[index]
@@ -226,10 +229,6 @@ function mt:setFalsy()
if hasBoolean then
self:merge(vm.declareGlobal('type', 'false'))
end
- if self.optional then
- self.optional = nil
- self:merge(vm.declareGlobal('type', 'nil'))
- end
return self
end