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.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua
index 959b7084..d2f88116 100644
--- a/script-beta/vm/getLibrary.lua
+++ b/script-beta/vm/getLibrary.lua
@@ -3,6 +3,9 @@ local library = require 'library'
local guide = require 'parser.guide'
local function checkStdLibrary(source)
+ if source.library then
+ return source
+ end
local globalName = vm.getGlobal(source)
if not globalName then
return nil
@@ -73,7 +76,7 @@ local function getLibrary(source)
return lib
end
return checkNode(source) or vm.eachRef(source, function (info)
- return checkNode(info.source)
+ return checkStdLibrary(info.source) or checkNode(info.source)
end)
end