summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server-beta/src/core/getfield.lua4
-rw-r--r--server-beta/src/core/local.lua8
-rw-r--r--server-beta/src/core/setmetatable.lua2
3 files changed, 12 insertions, 2 deletions
diff --git a/server-beta/src/core/getfield.lua b/server-beta/src/core/getfield.lua
index c76df24e..77a132ca 100644
--- a/server-beta/src/core/getfield.lua
+++ b/server-beta/src/core/getfield.lua
@@ -9,7 +9,9 @@ function m:field(source, key, callback)
used[source] = true
local node = source.node
- used[node] = true
+ self:eachDef(node, function (src)
+ used[src] = true
+ end)
local myKey = guide.getKeyName(source)
if key == myKey then
diff --git a/server-beta/src/core/local.lua b/server-beta/src/core/local.lua
index 44e14596..eb0c8900 100644
--- a/server-beta/src/core/local.lua
+++ b/server-beta/src/core/local.lua
@@ -107,6 +107,14 @@ function m:value(source, callback)
local ref = refs[i]
if ref.type == 'setlocal' then
self:eachValue(ref.value, callback)
+ elseif ref.type == 'getlocal' then
+ local parent = ref.parent
+ if parent.type == 'setmethod' then
+ local func = parent.value
+ if func and func.locals then
+ callback(func.locals[1])
+ end
+ end
end
end
end
diff --git a/server-beta/src/core/setmetatable.lua b/server-beta/src/core/setmetatable.lua
index ecb1a98d..978d165c 100644
--- a/server-beta/src/core/setmetatable.lua
+++ b/server-beta/src/core/setmetatable.lua
@@ -27,7 +27,7 @@ return function (self, key, used, found, callback)
end)
end
-- mt.__index.field -> t.field
- self:eachDef(src, function (src)
+ self:eachValue(src, function (src)
if used[src] then
self:eachValue(t, function (mtvalue)
self:eachField(mtvalue, key, callback)