summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 03:23:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 03:23:29 +0800
commit082327ae5f54d14685a5ce580cd216bc16ef409e (patch)
treec1755d745e732f1425bf001894a14bf1f5fc2eba /script/vm
parent8e1ec50cfb47b60cc9b4ab2821b93edacff2c8e1 (diff)
downloadlua-language-server-082327ae5f54d14685a5ce580cd216bc16ef409e.zip
`x = x or y` -> truthy
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index c69a7724..e50d3463 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -985,8 +985,7 @@ local compilerSwitch = util.switch()
elseif src.value
and src.value.type == 'binary'
and src.value.op and src.value.op.type == 'or'
- and src.value[1] and src.value[1].type == 'getlocal' and src.value[1].node == source
- and src.value[2] and guide.isLiteral(src.value[2]) then
+ and src.value[1] and src.value[1].type == 'getlocal' and src.value[1].node == source then
-- x = x or 1
vm.setNode(src, vm.compileNode(src.value))
else