diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 21:05:37 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 21:05:37 +0800 |
commit | 6aea81f55c385ba167119a7faeca3a143eedc1ec (patch) | |
tree | c2073352b230abe3976ee9a3f406635d546087af /script/vm/compiler.lua | |
parent | 317bced17780ebdeed67ed17590b7e2598b2b55a (diff) | |
download | lua-language-server-6aea81f55c385ba167119a7faeca3a143eedc1ec.zip |
fix
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r-- | script/vm/compiler.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index ff1e3a15..6c5f2b17 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1290,10 +1290,8 @@ local compilerSwitch = util.switch() end return vm.getNode(src) elseif src.type == 'getlocal' then - if bindAs(src) then - return - end - vm.setNode(src, node, true) + src._runnerNode = node + vm.removeNode(src) end end) @@ -1316,7 +1314,12 @@ local compilerSwitch = util.switch() if bindAs(source) then return end - vm.compileNode(source.node) + if not source._runnerNode then + vm.compileNode(source.node) + end + if source._runnerNode then + vm.setNode(source, source._runnerNode) + end end) : case 'setfield' : case 'setmethod' @@ -1850,7 +1853,9 @@ local function compileByCall(source) end end if needRemove then - myNode:removeNode(needRemove) + local newNode = myNode:copy() + newNode:removeNode(needRemove) + vm.setNode(source, newNode, true) end end |