mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-16 13:59:55 +02:00
Export global table only if "module()" is defined.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user