summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/l-package.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/l-package.lua')
-rw-r--r--tex/context/base/mkiv/l-package.lua25
1 files changed, 14 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/l-package.lua b/tex/context/base/mkiv/l-package.lua
index 0dd71e5ec..94607d436 100644
--- a/tex/context/base/mkiv/l-package.lua
+++ b/tex/context/base/mkiv/l-package.lua
@@ -54,7 +54,7 @@ local function lualibfile(name)
return lpegmatch(pattern,name) or name
end
-local offset = luarocks and 1 or 0 -- todo: also check other extras
+local offset = luarocks and 1 or 0 -- todo: also check other extras ... we'll drop this luarocks anyway
local helpers = package.helpers or {
cleanpath = cleanpath,
@@ -346,19 +346,22 @@ function helpers.loaded(name)
level = level + 1
for i=1,#sequence do
local method = sequence[i]
- if helpers.trace then
- helpers.report("%s, level '%s', method '%s', name '%s'","locating",level,method,name)
- end
- local result, rest = methods[method](name)
- if type(result) == "function" then
+ local lookup = method and methods[method]
+ if type(lookup) == "function" then
if helpers.trace then
- helpers.report("%s, level '%s', method '%s', name '%s'","found",level,method,name)
+ helpers.report("%s, level '%s', method '%s', name '%s'","locating",level,method,name)
end
- if helpers.traceused then
- used[#used+1] = { level = level, name = name }
+ local result, rest = lookup(name)
+ if type(result) == "function" then
+ if helpers.trace then
+ helpers.report("%s, level '%s', method '%s', name '%s'","found",level,method,name)
+ end
+ if helpers.traceused then
+ used[#used+1] = { level = level, name = name }
+ end
+ level = level - 1
+ return result, rest
end
- level = level - 1
- return result, rest
end
end
-- safeguard, we never come here