summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
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