Skip to content

Commit

Permalink
[Runtime] fix: compile init function before execution
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Nov 10, 2023
1 parent d8ea110 commit bc8e0b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lambda.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { basename, dirname, join } = require('path');
const { compile } = require('@jymfony/compiler');

try {
require('@jymfony/autoloader');
Expand Down Expand Up @@ -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.toString() + ')', null, { asFunction: false, debug: false }));
let started = false;
let [ app, args ] = runtime.getResolver(init).resolve();

Expand Down

0 comments on commit bc8e0b0

Please sign in to comment.