summaryrefslogtreecommitdiff
path: root/server-beta/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/core')
-rw-r--r--server-beta/src/core/engineer.lua6
-rw-r--r--server-beta/src/core/getfield.lua13
-rw-r--r--server-beta/src/core/getglobal.lua18
3 files changed, 17 insertions, 20 deletions
diff --git a/server-beta/src/core/engineer.lua b/server-beta/src/core/engineer.lua
index 4f29d1ea..656c29bf 100644
--- a/server-beta/src/core/engineer.lua
+++ b/server-beta/src/core/engineer.lua
@@ -293,15 +293,15 @@ function mt:childMode(source)
if source.type == 'getfield' then
return source.field, 'get'
elseif source.type == 'setfield' then
- return source.field, 'set'
+ return source.field, 'set', source.value
elseif source.type == 'getmethod' then
return source.method, 'get'
elseif source.type == 'setmethod' then
- return source.method, 'set'
+ return source.method, 'set', source.value
elseif source.type == 'getindex' then
return source.index, 'get'
elseif source.type == 'setindex' then
- return source.index, 'set'
+ return source.index, 'set', source.value
elseif source.type == 'field' then
return self:childMode(source.parent)
elseif source.type == 'method' then
diff --git a/server-beta/src/core/getfield.lua b/server-beta/src/core/getfield.lua
index c7d16316..fd0c8f33 100644
--- a/server-beta/src/core/getfield.lua
+++ b/server-beta/src/core/getfield.lua
@@ -29,11 +29,14 @@ function m:field(source, key, callback)
self:eachRef(source, function (src)
used[src] = true
- local child, mode = self:childMode(src)
+ local child, mode, value = self:childMode(src)
if child then
if key == guide.getKeyName(child) then
callback(child, mode)
end
+ if value then
+ self:eachField(value, key, callback)
+ end
return
end
if src.type == 'getglobal' then
@@ -45,13 +48,7 @@ function m:field(source, key, callback)
end
end
elseif src.type == 'setglobal' then
- local parent = src.parent
- child, mode = self:childMode(parent)
- if child then
- if key == guide.getKeyName(child) then
- callback(child, mode)
- end
- end
+ self:eachField(src.value, key, callback)
else
self:eachField(src, key, callback)
end
diff --git a/server-beta/src/core/getglobal.lua b/server-beta/src/core/getglobal.lua
index a6814a7d..05429c64 100644
--- a/server-beta/src/core/getglobal.lua
+++ b/server-beta/src/core/getglobal.lua
@@ -68,29 +68,29 @@ function m:field(source, key, callback)
self:eachRef(source, function (src)
used[src] = true
- local child, mode = self:childMode(src)
+ local child, mode, value = self:childMode(src)
if child then
if key == guide.getKeyName(child) then
callback(child, mode)
end
+ if value then
+ self:eachField(value, key, callback)
+ end
return
end
if src.type == 'getglobal' then
local parent = src.parent
- child, mode = self:childMode(parent)
+ child, mode, value = self:childMode(parent)
if child then
if key == guide.getKeyName(child) then
callback(child, mode)
end
- end
- elseif src.type == 'setglobal' then
- local parent = src.parent
- child, mode = self:childMode(parent)
- if child then
- if key == guide.getKeyName(child) then
- callback(child, mode)
+ if value then
+ self:eachField(value, key, callback)
end
end
+ elseif src.type == 'setglobal' then
+ self:eachField(src.value, key, callback)
else
self:eachField(src, key, callback)
end