|
|
|
@ -85,26 +85,27 @@ local function new_thread(ctx, action, action_arg, ...)
|
|
|
|
}, thread_mt)
|
|
|
|
}, thread_mt)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
module(...)
|
|
|
|
local M = {}
|
|
|
|
|
|
|
|
|
|
|
|
function set_bootstrap_prelude(code)
|
|
|
|
function M.set_bootstrap_prelude(code)
|
|
|
|
bootstrap_code = bootstrap_pre .. code .. bootstrap_post
|
|
|
|
bootstrap_code = bootstrap_pre .. code .. bootstrap_post
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function runfile(ctx, file, ...)
|
|
|
|
function M.runfile(ctx, file, ...)
|
|
|
|
return new_thread(ctx, 'runfile', file, ...)
|
|
|
|
return new_thread(ctx, 'runfile', file, ...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function runstring(ctx, code, ...)
|
|
|
|
function M.runstring(ctx, code, ...)
|
|
|
|
return new_thread(ctx, 'runstring', code, ...)
|
|
|
|
return new_thread(ctx, 'runstring', code, ...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local parent_ctx = nil
|
|
|
|
local parent_ctx = nil
|
|
|
|
function set_parent_ctx(ctx)
|
|
|
|
function M.set_parent_ctx(ctx)
|
|
|
|
parent_ctx = ctx
|
|
|
|
parent_ctx = ctx
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function get_parent_ctx(ctx)
|
|
|
|
function M.get_parent_ctx(ctx)
|
|
|
|
return parent_ctx
|
|
|
|
return parent_ctx
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return M
|
|
|
|
|