From 1feac7bd778525be74492acafb15d387f0132973 Mon Sep 17 00:00:00 2001 From: Alessandro Chitolina Date: Fri, 10 Nov 2023 17:58:54 +0100 Subject: [PATCH] [Runtime] fix: compile init function before execution --- lambda.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lambda.js b/lambda.js index 4cd2caf..49d9953 100644 --- a/lambda.js +++ b/lambda.js @@ -1,4 +1,5 @@ const { basename, dirname, join } = require('path'); +const { compile } = require('@jymfony/compiler'); try { require('@jymfony/autoloader'); @@ -55,6 +56,7 @@ const reflection = new ReflectionClass(runtime); runtime = reflection.newInstance(Object.assign({ project_dir: dirname(file) }, nullish(globalThis.APP_RUNTIME_OPTIONS, () => ({})))); module.exports = function (init) { + init = eval(compile(init, null, { asFunction: false, debug: false })); let started = false; let [ app, args ] = runtime.getResolver(init).resolve();