feat: simplify global function assignment in Vm class and enable logging of results in case1-payload test
This commit is contained in:
@ -48,12 +48,7 @@ export class Vm {
|
||||
|
||||
await this.context.evalClosure(
|
||||
`
|
||||
const name = $0;
|
||||
const method = $1;
|
||||
const ref = $2;
|
||||
const ns = globalThis[name];
|
||||
|
||||
ns[method] = (...args) => ref.apply(undefined, args, {
|
||||
globalThis[$0][$1] = (...args) => $2.apply(undefined, args, {
|
||||
arguments: { copy: true },
|
||||
result: { promise: true, copy: true }
|
||||
});
|
||||
@ -85,7 +80,7 @@ export class Vm {
|
||||
});
|
||||
|
||||
this.setFunction("returnResult", (res) => {
|
||||
// console.log("Returning result from VM:", res);
|
||||
console.log("Returning result from VM:", res);
|
||||
|
||||
resolvePromise(res);
|
||||
});
|
||||
|
||||
@ -17,7 +17,7 @@ async function main(input, headers) {
|
||||
|
||||
const res = await db.execute(sql);
|
||||
|
||||
// log(res);
|
||||
log(res);
|
||||
|
||||
return {
|
||||
response: {
|
||||
|
||||
Reference in New Issue
Block a user