# HG changeset patch # User jbe # Date 1425161500 -3600 # Node ID 82cc171e8510bff95e32c111dd4bb561d5e3f61c # Parent 2eda136b0394bfceb90389a02e1be37b74c1de53 Pass _ENV to loaded chunks diff -r 2eda136b0394 -r 82cc171e8510 framework/bin/mcp.lua --- a/framework/bin/mcp.lua Sat Feb 28 23:04:43 2015 +0100 +++ b/framework/bin/mcp.lua Sat Feb 28 23:11:40 2015 +0100 @@ -100,7 +100,7 @@ if file then local filedata = file:read("*a") io.close(file) - local func, errmsg = load(filedata, "=" .. filename) + local func, errmsg = load(filedata, "=" .. filename, nil, _ENV) if func then func() return true diff -r 2eda136b0394 -r 82cc171e8510 framework/env/execute/chunk.lua --- a/framework/env/execute/chunk.lua Sat Feb 28 23:04:43 2015 +0100 +++ b/framework/env/execute/chunk.lua Sat Feb 28 23:11:40 2015 +0100 @@ -35,7 +35,7 @@ WEBMCP_BASE_PATH, 'app', app, module, chunk .. '.lua' ) - local func, load_errmsg = loadfile(file_path) + local func, load_errmsg = loadfile(file_path, nil, _ENV) if not func then error('Could not load file "' .. file_path .. '": ' .. load_errmsg) end diff -r 2eda136b0394 -r 82cc171e8510 framework/env/execute/file_path.lua --- a/framework/env/execute/file_path.lua Sat Feb 28 23:04:43 2015 +0100 +++ b/framework/env/execute/file_path.lua Sat Feb 28 23:11:40 2015 +0100 @@ -14,7 +14,7 @@ local file_path = args.file_path local id = args.id local params = args.params - local func, load_errmsg = loadfile(file_path) + local func, load_errmsg = loadfile(file_path, nil, _ENV) if not func then error('Could not load file "' .. file_path .. '": ' .. load_errmsg) end