File tree Expand file tree Collapse file tree
modules/code-generator/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ export class ProjectBuilder implements IProjectBuilder {
320320 // template: this.template,
321321 inStrictMode : this . inStrictMode ,
322322 tolerateEvalErrors : true ,
323- evalErrorsHandler : '' ,
323+ evalErrorsHandler : 'console.error(error) ' ,
324324 ...this . extraContextData ,
325325 ...extraContextData ,
326326 } ,
Original file line number Diff line number Diff line change @@ -79,7 +79,12 @@ function getBodyStatements(content: string) {
7979 throw new Error ( 'Can not find Function Statement' ) ;
8080}
8181
82- export function isJsCode ( value : unknown ) : boolean {
82+ /**
83+ * 是否是广义上的 JSFunction
84+ * @param value
85+ * @returns
86+ */
87+ export function isBroadJSFunction ( value : unknown ) : boolean {
8388 return isJSExpressionFn ( value ) || isJSFunction ( value ) ;
8489}
8590
@@ -117,7 +122,7 @@ export function generateFunction(
117122 isBindExpr : false ,
118123 } ,
119124) {
120- if ( isJsCode ( value ) ) {
125+ if ( isBroadJSFunction ( value ) ) {
121126 const functionCfg = value as IPublicTypeJSFunction ;
122127 const functionSource = getFunctionSource ( functionCfg ) ;
123128 if ( config . isMember ) {
You can’t perform that action at this time.
0 commit comments