Codebase list lua-ldoc / 320dfed
no longer any need for setfenv in markdown.lua steve donovan 10 years ago
1 changed file(s) with 1 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
117117
118118
119119 -- Set up a table for holding local functions to avoid polluting the global namespace
120 -- Penlight 1.2 defines compatible 5.1 setfenv in utils table
120121 local M = {}
121122 local MT = {__index = _G}
122123 setmetatable(M, MT)
123 if setfenv then setfenv(1, M) end -- if true, we are using LUA 5.1
124124
125125 ----------------------------------------------------------------------
126126 -- Utility functions
11331133 -- End of module
11341134 ----------------------------------------------------------------------
11351135
1136 if setfenv then setfenv(1, _G) end
11371136 M.lock(M)
11381137
11391138 -- Expose markdown function to the world