Lua fixes
parent
6a65912b94
commit
6d42423e8d
|
@ -30,7 +30,10 @@ import { templateApi } from "$common/space_lua/stdlib/template.ts";
|
||||||
import { mathApi } from "$common/space_lua/stdlib/math.ts";
|
import { mathApi } from "$common/space_lua/stdlib/math.ts";
|
||||||
|
|
||||||
const printFunction = new LuaBuiltinFunction(async (_sf, ...args) => {
|
const printFunction = new LuaBuiltinFunction(async (_sf, ...args) => {
|
||||||
console.log("[Lua]", ...(await Promise.all(args.map(luaToString))));
|
console.log(
|
||||||
|
"[Lua]",
|
||||||
|
...(await Promise.all(args.map((v) => luaToString(v)))),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const assertFunction = new LuaBuiltinFunction(
|
const assertFunction = new LuaBuiltinFunction(
|
||||||
|
|
|
@ -120,15 +120,15 @@ function exposeDefinitions(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function buildThreadLocalEnv(system: System<any>, globalEnv: LuaEnv) {
|
function buildThreadLocalEnv(_system: System<any>, globalEnv: LuaEnv) {
|
||||||
const tl = new LuaEnv();
|
const tl = new LuaEnv();
|
||||||
const currentPageMeta = await system.localSyscall(
|
// const currentPageMeta = await system.localSyscall(
|
||||||
"editor.getCurrentPageMeta",
|
// "editor.getCurrentPageMeta",
|
||||||
[],
|
// [],
|
||||||
);
|
// );
|
||||||
tl.setLocal("pageMeta", currentPageMeta);
|
// tl.setLocal("pageMeta", currentPageMeta);
|
||||||
tl.setLocal("_GLOBAL", globalEnv);
|
tl.setLocal("_GLOBAL", globalEnv);
|
||||||
return tl;
|
return Promise.resolve(tl);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleLuaError(e: any, system: System<any>) {
|
async function handleLuaError(e: any, system: System<any>) {
|
||||||
|
|
Loading…
Reference in New Issue