summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-28 20:26:54 +0800
committersumneko <sumneko@hotmail.com>2019-04-28 20:26:54 +0800
commit72787989fa47f50589aa025f52df0a05f0692043 (patch)
treefa122371017c11e744a4fb7e9d81018dffa78b29 /server
parentd1274f277907b4b7e45dd018f5617708ea37636d (diff)
downloadlua-language-server-72787989fa47f50589aa025f52df0a05f0692043.zip
尝试处理一下过期的local
Diffstat (limited to 'server')
-rw-r--r--server/src/vm/function.lua12
-rw-r--r--server/src/vm/local.lua3
2 files changed, 11 insertions, 4 deletions
diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua
index 4c2f0be5..b6a8ae87 100644
--- a/server/src/vm/function.lua
+++ b/server/src/vm/function.lua
@@ -78,7 +78,11 @@ function mt:loadLocal(name)
local locals = self.locals[i]
local loc = locals[name]
if loc then
- return loc
+ if loc:getSource() then
+ return loc
+ else
+ locals[name] = nil
+ end
end
if self.chunk[i] then
break
@@ -86,7 +90,11 @@ function mt:loadLocal(name)
end
local uv = self.upvalues[name]
if uv then
- return uv
+ if uv:getSource() then
+ return uv
+ else
+ self.upvalues[name] = nil
+ end
end
return nil
end
diff --git a/server/src/vm/local.lua b/server/src/vm/local.lua
index c6e67dbf..3591eab9 100644
--- a/server/src/vm/local.lua
+++ b/server/src/vm/local.lua
@@ -114,8 +114,7 @@ function mt:shadow(old)
self._shadow = group
if not self:getSource() then
- log.error(table.dump(self))
- log.error(table.dump(getmetatable(self)))
+ log.error('local no source')
return
end