summaryrefslogtreecommitdiff
path: root/server/src/vm
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/vm')
-rw-r--r--server/src/vm/value.lua25
-rw-r--r--server/src/vm/vm.lua1
2 files changed, 13 insertions, 13 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 4fa4b53b..a1ee897b 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -138,17 +138,7 @@ function mt:eachLibChild(callback)
end
end
-function mt:getChild(index, source)
- local value = self:_getChild(index)
- if not value then
- value = create('any', source)
- self:setChild(index, value)
- value.uri = self.uri
- end
- return value
-end
-
-function mt:_getChild(index, source, mark)
+local function finishGetChild(self, index, source, mark)
self:setType('table', 0.5)
local value = self:rawGet(index)
if value then
@@ -166,7 +156,18 @@ function mt:_getChild(index, source, mark)
return nil
end
mark[method] = true
- return method:_getChild(index, source, mark)
+
+ return finishGetChild(method, index, source, mark)
+end
+
+function mt:getChild(index, source)
+ local value = finishGetChild(self, index)
+ if not value then
+ value = create('any', source)
+ self:setChild(index, value)
+ value.uri = self.uri
+ end
+ return value
end
function mt:bindChild(other)
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 4435d7d5..093122e4 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -1113,7 +1113,6 @@ end
function mt:createLocal(key, source, value)
local loc = self:bindLocal(source)
if loc then
- self:saveLocal(key, loc)
return loc
end