summaryrefslogtreecommitdiff
path: root/server/src/vm/vm.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-08 17:36:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-08 17:36:29 +0800
commita310232d2d873813023b099292efd9a78551e4d7 (patch)
tree1b2409de06813f0558f872954d780fe8b840a0fe /server/src/vm/vm.lua
parentbdbe552e97098e617b8eecb5cd32ec229485fe8b (diff)
downloadlua-language-server-a310232d2d873813023b099292efd9a78551e4d7.zip
require相关
Diffstat (limited to 'server/src/vm/vm.lua')
-rw-r--r--server/src/vm/vm.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 4ff5f372..643c68ea 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -349,7 +349,7 @@ function mt:getName(name, source)
end
local ENV = self:loadLocal('_ENV')
local ENVValue = ENV:getValue()
- global = ENVValue:getChild(name) or ENVValue:setChild(name, createValue('any', source))
+ global = ENVValue:getChild(name, source)
source:bindValue(global, 'get')
source:set('global', true)
source:set('parent', ENVValue)
@@ -477,12 +477,12 @@ function mt:getSimple(simple, max)
source:set('parent', value)
local child = source[1]
local index = self:getIndex(child)
- value = value:getChild(index) or value:setChild(index, createValue('any', source))
+ value = value:getChild(index, source)
source:bindValue(value, 'get')
elseif source.type == 'name' then
source:set('parent', value)
source:set('object', object)
- value = value:getChild(source[1]) or value:setChild(source[1], createValue('any', source))
+ value = value:getChild(source[1], source)
source:bindValue(value, 'get')
elseif source.type == ':' then
object = value