Skip to content

Commit b063d9a

Browse files
committed
cleanup
1 parent a263161 commit b063d9a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

script/vm/compiler.lua

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,15 +1163,25 @@ local compilerSwitch = util.switch()
11631163
vm.setNode(src, vm.createNode(src.value))
11641164
vm.setNode(src, node:copy():asTable())
11651165
else
1166-
guide.eachSource(src.value, function (child)
1167-
if child.type == 'getlocal'
1168-
and child.node == source then
1166+
local function clearLockedNode(child)
1167+
if not child then
11691168
return
11701169
end
1170+
if child.type == 'function' then
1171+
return
1172+
end
1173+
if child.type == 'setlocal'
1174+
or child.type == 'getlocal' then
1175+
if child.node == source then
1176+
return
1177+
end
1178+
end
11711179
if LOCK[child] then
11721180
vm.removeNode(child)
11731181
end
1174-
end)
1182+
guide.eachChild(child, clearLockedNode)
1183+
end
1184+
clearLockedNode(src.value)
11751185
vm.setNode(src, vm.compileNode(src.value), true)
11761186
end
11771187
else

0 commit comments

Comments
 (0)