From 6e2d3d42dba22ee9f179546b1e92d0b3313ec1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 15 Dec 2022 21:09:14 +0800 Subject: stash --- script/vm/node.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'script/vm/node.lua') 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 -- cgit v1.2.3