diff --git a/src/vm/vm.class.ts b/src/vm/vm.class.ts index 26397a5..e5843f2 100644 --- a/src/vm/vm.class.ts +++ b/src/vm/vm.class.ts @@ -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); }); diff --git a/tests/base/case1-payload.js b/tests/base/case1-payload.js index c560a60..3eb2860 100644 --- a/tests/base/case1-payload.js +++ b/tests/base/case1-payload.js @@ -17,7 +17,7 @@ async function main(input, headers) { const res = await db.execute(sql); - // log(res); + log(res); return { response: {