summaryrefslogtreecommitdiff
path: root/script/vm/operator.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-03-09 14:54:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-03-09 14:54:49 +0800
commita9fe326bb74a35501748fe1b265d9dbf268cfe88 (patch)
tree89c275f7367d2af2c431623318444ec1ac7c5a8e /script/vm/operator.lua
parentd7d44a727087337638b3fe8ff0a45a12945b2d03 (diff)
downloadlua-language-server-a9fe326bb74a35501748fe1b265d9dbf268cfe88.zip
support `x or error(...)`
fix #1945
Diffstat (limited to 'script/vm/operator.lua')
-rw-r--r--script/vm/operator.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/vm/operator.lua b/script/vm/operator.lua
index cb27d33d..b2a3aa10 100644
--- a/script/vm/operator.lua
+++ b/script/vm/operator.lua
@@ -199,7 +199,10 @@ vm.binarySwitch = util.switch()
elseif r1 == false then
vm.setNode(source, node2)
else
- local node = node1:copy():setTruthy():merge(node2)
+ local node = node1:copy():setTruthy()
+ if not source[2].hasExit then
+ node:merge(node2)
+ end
vm.setNode(source, node)
end
end)