diff options
Diffstat (limited to 'server-beta/src/searcher/eachField.lua')
-rw-r--r-- | server-beta/src/searcher/eachField.lua | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/server-beta/src/searcher/eachField.lua b/server-beta/src/searcher/eachField.lua index 8b987cc2..8fea864e 100644 --- a/server-beta/src/searcher/eachField.lua +++ b/server-beta/src/searcher/eachField.lua @@ -41,17 +41,33 @@ end local function ofVar(searcher, source, callback) local parent = source.parent - if parent then - if parent.type == 'getfield' - or parent.type == 'getmethod' - or parent.type == 'getindex' - or parent.type == 'setfield' - or parent.type == 'setmethod' - or parent.type == 'setindex' then - callback { - searcher = searcher, - source = parent, - } + if not parent then + return + end + if parent.type == 'getfield' + or parent.type == 'getmethod' + or parent.type == 'getindex' + or parent.type == 'setfield' + or parent.type == 'setmethod' + or parent.type == 'setindex' then + callback { + searcher = searcher, + source = parent, + } + return + end + if parent.type == 'callargs' then + local call = parent.parent + local func = call.node + local name = searcher:getSpecialName(func) + if name == 'rawset' + or name == 'rawget' then + if parent[1] == source then + callback { + searcher = searcher, + source = call, + } + end end end end |