Expose globals in root of Lua scripts
parent
63cc7132ee
commit
fe9e3c6eda
|
@ -33,6 +33,7 @@ export class SpaceLuaEnvironment {
|
|||
try {
|
||||
this.env = buildLuaEnv(system, scriptEnv);
|
||||
const tl = new LuaEnv();
|
||||
tl.setLocal("_GLOBAL", this.env);
|
||||
for (const script of allScripts) {
|
||||
try {
|
||||
console.log("Now evaluating", script.ref);
|
||||
|
|
|
@ -27,7 +27,7 @@ import type {
|
|||
import { templateApi } from "$common/space_lua/stdlib/template.ts";
|
||||
|
||||
const printFunction = new LuaBuiltinFunction(async (_sf, ...args) => {
|
||||
console.log("[Lua]", ...(await Promise.all(args)));
|
||||
console.log("[Lua]", ...(await Promise.all(args.map(luaToString))));
|
||||
});
|
||||
|
||||
const assertFunction = new LuaBuiltinFunction(
|
||||
|
|
Loading…
Reference in New Issue