From 5370e58f0c54f840f423e7b666df301499eca4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 19 Oct 2019 14:42:25 +0800 Subject: =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/core/getfield.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'server-beta/src/core/getfield.lua') diff --git a/server-beta/src/core/getfield.lua b/server-beta/src/core/getfield.lua index aa07719b..badd41cf 100644 --- a/server-beta/src/core/getfield.lua +++ b/server-beta/src/core/getfield.lua @@ -5,11 +5,21 @@ local m = {} function m:ref(source, callback) local key = guide.getKeyName(source) - self:eachField(source.node, key, function (src, mode) - if mode == 'set' or mode == 'get' then - callback(src, mode) - end - end) + local node = source.node + if node.type == 'setfield' + or node.type == 'getfield' + or node.type == 'setmethod' + or node.type == 'getmethod' + or node.type == 'setindex' + or node.type == 'getindex' then + self:eachField(node.node, key, function (src, mode) + if mode == 'set' or mode == 'get' then + callback(src, mode) + end + end) + else + self:eachRef(node, callback) + end end function m:field(source, key, callback) -- cgit v1.2.3