mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-10 18:03:01 +00:00
Merge branch 'feat/0228' of github.com:alibaba/lowcode-engine into feat/0228
This commit is contained in:
commit
3ddc8f14f8
@ -320,7 +320,7 @@ export class ProjectBuilder implements IProjectBuilder {
|
||||
// template: this.template,
|
||||
inStrictMode: this.inStrictMode,
|
||||
tolerateEvalErrors: true,
|
||||
evalErrorsHandler: '',
|
||||
evalErrorsHandler: 'console.error(error)',
|
||||
...this.extraContextData,
|
||||
...extraContextData,
|
||||
},
|
||||
|
||||
@ -79,7 +79,12 @@ function getBodyStatements(content: string) {
|
||||
throw new Error('Can not find Function Statement');
|
||||
}
|
||||
|
||||
export function isJsCode(value: unknown): boolean {
|
||||
/**
|
||||
* 是否是广义上的 JSFunction
|
||||
* @param value
|
||||
* @returns
|
||||
*/
|
||||
export function isBroadJSFunction(value: unknown): boolean {
|
||||
return isJSExpressionFn(value) || isJSFunction(value);
|
||||
}
|
||||
|
||||
@ -117,7 +122,7 @@ export function generateFunction(
|
||||
isBindExpr: false,
|
||||
},
|
||||
) {
|
||||
if (isJsCode(value)) {
|
||||
if (isBroadJSFunction(value)) {
|
||||
const functionCfg = value as IPublicTypeJSFunction;
|
||||
const functionSource = getFunctionSource(functionCfg);
|
||||
if (config.isMember) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user