File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
modules/code-generator/src Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ export class ProjectBuilder implements IProjectBuilder {
328328 // template: this.template,
329329 inStrictMode : this . inStrictMode ,
330330 tolerateEvalErrors : true ,
331- evalErrorsHandler : '' ,
331+ evalErrorsHandler : 'console.error(error) ' ,
332332 ...this . extraContextData ,
333333 ...extraContextData ,
334334 } ,
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