Skip to content

Commit e6fa812

Browse files
committed
fix(func engine): fix func engine bug;
1 parent 680476f commit e6fa812

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/faas/engine.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
${code};
2121
const __main__ = exports.main || exports.default
2222
if(!__main__) { throw new Error('FunctionExecError: main function not found') }
23-
if(!(__main__ instanceof Function)) { throw new Error('FunctionExecError: main function must be callable')}
23+
if(typeof __main__ !== 'function') { throw new Error('FunctionExecError: main function must be callable')}
2424
__runtime_promise = __main__(__context__ )
2525
`
2626

@@ -30,7 +30,7 @@
3030
const sandbox: RuntimeContext = {
3131
__context__: incomingCtx.context,
3232
module: _module,
33-
exports: module.exports,
33+
exports: _module.exports,
3434
__runtime_promise: null,
3535
console: fconsole,
3636
less: incomingCtx.less,

0 commit comments

Comments
 (0)