diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-09-27 10:59:21 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-09-27 10:59:21 +0800 |
commit | 832c408c4f574c1e3ea9457d3d4e376f63040924 (patch) | |
tree | cfe79a64c2b0d779c3d2b51fd5af3712563e4d6f /server/src/vm/vm.lua | |
parent | 76bf5108d5fb0723d658598c8cc56c8f8fb16127 (diff) | |
download | lua-language-server-832c408c4f574c1e3ea9457d3d4e376f63040924.zip |
fixed #93
Diffstat (limited to 'server/src/vm/vm.lua')
-rw-r--r-- | server/src/vm/vm.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index 93b9eb8e..ce4ca020 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -979,16 +979,18 @@ function mt:doFunction(action) source:bindValue(value, 'set') local func = value:getFunction() - if #name == 3 then - -- function x:b() - local loc = self:loadLocal(name[1][1]) - if loc then - func:setObject(parent, loc:getSource()) + if func then + if #name == 3 then + -- function x:b() + local loc = self:loadLocal(name[1][1]) + if loc then + func:setObject(parent, loc:getSource()) + else + func:setObject(parent, name[#name-2]) + end else func:setObject(parent, name[#name-2]) end - else - func:setObject(parent, name[#name-2]) end else local value = self:buildFunction(action) |