diff options
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/core/hover/table.lua | 3 | ||||
-rw-r--r-- | script-beta/vm/eachRef.lua | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua index 9292d183..466d572b 100644 --- a/script-beta/core/hover/table.lua +++ b/script-beta/core/hover/table.lua @@ -3,6 +3,9 @@ local util = require 'utility' local getClass = require 'core.hover.class' local function getKey(info) + if not info.key then + return 'any' + end local ktype = info.key:sub(1, 2) if ktype == 's|' then return info.key:sub(3) diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua index d0ba1ade..0d772209 100644 --- a/script-beta/vm/eachRef.lua +++ b/script-beta/vm/eachRef.lua @@ -245,6 +245,21 @@ local function asArg(source, callback) end end +--- 自己作为函数的返回值 +local function asReturn(source, callback) + local parent = source.parent + if parent.type ~= 'return' then + return + end + local func = guide.getParentFunction(source) + if func.type == 'main' then + else + vm.eachRef(func, function (info) + + end) + end +end + local function ofLocal(loc, callback) -- 方法中的 self 使用了一个虚拟的定义位置 if loc.tag ~= 'self' then @@ -444,6 +459,7 @@ local function eachRef(source, callback) ofMain(source, callback) end asArg(source, callback) + asReturn(source, callback) end --- 判断2个对象是否拥有相同的引用 |