summaryrefslogtreecommitdiff
path: root/script-beta/vm/getLibrary.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/vm/getLibrary.lua')
-rw-r--r--script-beta/vm/getLibrary.lua16
1 files changed, 10 insertions, 6 deletions
diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua
index fd05347e..959b7084 100644
--- a/script-beta/vm/getLibrary.lua
+++ b/script-beta/vm/getLibrary.lua
@@ -54,13 +54,17 @@ local function getNodeAsObject(source)
end
local function checkNode(source)
- if source.type ~= 'getfield'
- and source.type ~= 'getmethod'
- and source.type ~= 'getindex' then
- return nil
+ if source.type == 'method' then
+ source = source.parent
+ elseif source.type == 'field' then
+ source = source.parent
+ end
+ if source.type == 'getfield'
+ or source.type == 'getmethod'
+ or source.type == 'getindex' then
+ return getNodeAsTable(source)
+ or getNodeAsObject(source)
end
- return getNodeAsTable(source)
- or getNodeAsObject(source)
end
local function getLibrary(source)