mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
feat: console the expression error
This commit is contained in:
parent
37e07bb238
commit
76f5ee4cf8
@ -328,7 +328,7 @@ export class ProjectBuilder implements IProjectBuilder {
|
|||||||
// template: this.template,
|
// template: this.template,
|
||||||
inStrictMode: this.inStrictMode,
|
inStrictMode: this.inStrictMode,
|
||||||
tolerateEvalErrors: true,
|
tolerateEvalErrors: true,
|
||||||
evalErrorsHandler: '',
|
evalErrorsHandler: 'console.error(error)',
|
||||||
...this.extraContextData,
|
...this.extraContextData,
|
||||||
...extraContextData,
|
...extraContextData,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -79,7 +79,12 @@ function getBodyStatements(content: string) {
|
|||||||
throw new Error('Can not find Function Statement');
|
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);
|
return isJSExpressionFn(value) || isJSFunction(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +122,7 @@ export function generateFunction(
|
|||||||
isBindExpr: false,
|
isBindExpr: false,
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
if (isJsCode(value)) {
|
if (isBroadJSFunction(value)) {
|
||||||
const functionCfg = value as IPublicTypeJSFunction;
|
const functionCfg = value as IPublicTypeJSFunction;
|
||||||
const functionSource = getFunctionSource(functionCfg);
|
const functionSource = getFunctionSource(functionCfg);
|
||||||
if (config.isMember) {
|
if (config.isMember) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user