diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-24 03:23:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-24 03:23:29 +0800 |
commit | 082327ae5f54d14685a5ce580cd216bc16ef409e (patch) | |
tree | c1755d745e732f1425bf001894a14bf1f5fc2eba /script/vm | |
parent | 8e1ec50cfb47b60cc9b4ab2821b93edacff2c8e1 (diff) | |
download | lua-language-server-082327ae5f54d14685a5ce580cd216bc16ef409e.zip |
`x = x or y` -> truthy
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/compiler.lua | 3 |
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 |