diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-12-15 16:46:59 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-12-15 16:46:59 +0800 |
commit | 244a19d365d8b3d3881492e08fefa9847bd11a2f (patch) | |
tree | b71dfe508b14015690a824be3d0f7f57ff1fba16 /script/vm/node.lua | |
parent | 0ab880ea3e3ef74c91dc56e449b4b7d60d654d8f (diff) | |
download | lua-language-server-244a19d365d8b3d3881492e08fefa9847bd11a2f.zip |
add supports for merging with `ifblock`
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r-- | script/vm/node.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua index 2e408128..d0fd5ffb 100644 --- a/script/vm/node.lua +++ b/script/vm/node.lua @@ -188,9 +188,6 @@ 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] @@ -229,6 +226,10 @@ 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 |