summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-29 16:09:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-29 16:09:47 +0800
commit349237eb93facad91ca7389c56de9bb30f60066b (patch)
tree3622bd215b5253b9c8413288bc6269f190d40299 /script
parent46910e464bfab9992895898b4c1795e494796e39 (diff)
downloadlua-language-server-349237eb93facad91ca7389c56de9bb30f60066b.zip
remove optionals for all vars of `for .. in`
Diffstat (limited to 'script')
-rw-r--r--script/vm/compiler.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 5a306308..1abad3e3 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -911,12 +911,8 @@ local function compileForVars(source)
if source.keys then
for i, loc in ipairs(source.keys) do
local node = getReturn(source._iterator, i, source._iterArgs)
- if node then
- if i == 1 then
- node:removeOptional()
- end
- source._iterVars[loc] = node
- end
+ node:removeOptional()
+ source._iterVars[loc] = node
end
end
end