Export global table only if "module()" is defined.
This commit is contained in:
parent
b1d1e721d1
commit
bc709ac7b7
2 changed files with 24 additions and 21 deletions
|
@ -10,9 +10,10 @@
|
|||
local string = require("string")
|
||||
local table = require("table")
|
||||
local base = _G
|
||||
ltn12 = {}
|
||||
local _M = ltn12
|
||||
|
||||
local _M = {}
|
||||
if module then -- heuristic for exporting a global package table
|
||||
ltn12 = _M
|
||||
end
|
||||
local filter,source,sink,pump = {},{},{},{}
|
||||
|
||||
_M.filter = filter
|
||||
|
@ -294,4 +295,4 @@ function pump.all(src, snk, step)
|
|||
end
|
||||
end
|
||||
|
||||
return _M
|
||||
return _M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue