diff options
Diffstat (limited to 'src/cratera/bootstrap.lua')
-rw-r--r-- | src/cratera/bootstrap.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cratera/bootstrap.lua b/src/cratera/bootstrap.lua index 88cef17..c9c7096 100644 --- a/src/cratera/bootstrap.lua +++ b/src/cratera/bootstrap.lua @@ -55,11 +55,13 @@ local cratera = require "cratera" local cratera_env = setmetatable({lua=_G}, {__index=_G}) cratera_env._G = cratera_env +cratera_env._VERSION = cratera._VERSION -- cratera.lib actually injects itself into *us*! package.loaded[...] = cratera_env local io_open = io.open local stdin = io.stdin + -- only use setfenv if load doesn't support env argument local setfenv = (loadstring or load)("return setfenv", nil, nil, {})() -- we don't know the real BUFSIZ, use a common memory page size (16K, as on M1) @@ -155,7 +157,7 @@ local function cratera_loadfile(filename, mode, env) end local func, loader_err = cratera_loader_base(function() return reader() - end, filename, mode, env) + end, chunkname, mode, env) local closeok, closeerr = file:close() -- at this point, err_or_more_data *should* be nil. if err_or_more_data then |