Skip to content

Commit

Permalink
fix(func engine): fix func engine bug;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Jul 23, 2021
1 parent 680476f commit e6fa812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/faas/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
${code};
const __main__ = exports.main || exports.default
if(!__main__) { throw new Error('FunctionExecError: main function not found') }
if(!(__main__ instanceof Function)) { throw new Error('FunctionExecError: main function must be callable')}
if(typeof __main__ !== 'function') { throw new Error('FunctionExecError: main function must be callable')}
__runtime_promise = __main__(__context__ )
`

Expand All @@ -30,7 +30,7 @@
const sandbox: RuntimeContext = {
__context__: incomingCtx.context,
module: _module,
exports: module.exports,
exports: _module.exports,
__runtime_promise: null,
console: fconsole,
less: incomingCtx.less,
Expand Down

0 comments on commit e6fa812

Please sign in to comment.