@@ -26,13 +26,17 @@ function runEval(System, code, options) {
2626
2727 var originalCode = code ;
2828
29+ System . debug && console . log ( `[lively.module] runEval: ${ code . slice ( 0 , 100 ) . replace ( / \n / mg, " " ) } ...` ) ;
30+
2931 return Promise . resolve ( )
3032 . then ( ( ) => {
3133 var targetModule = options . targetModule || "*scratch*" ;
3234 return System . normalize ( targetModule , options . parentModule , options . parentAddress ) ;
3335 } )
3436 . then ( ( targetModule ) => {
3537 var fullname = options . targetModule = targetModule ;
38+ System . debug && console . log ( `[lively.module] runEval in module ${ targetModule } started` ) ;
39+
3640 return System . import ( fullname )
3741 . then ( ( ) => ensureImportsAreLoaded ( System , code , fullname ) )
3842 . then ( ( ) => {
@@ -60,6 +64,7 @@ function runEval(System, code, options) {
6064 Date . now ( ) ) ;
6165
6266 return realRunEval ( code , options ) . then ( result => {
67+ System . debug && console . log ( `[lively.module] runEval in module ${ targetModule } done` ) ;
6368 System [ "__lively.modules__" ] . evaluationDone ( fullname ) ;
6469 recordDoitResult (
6570 System , originalCode ,
@@ -178,6 +183,8 @@ function runEvalWithAsyncSupport(System, code, options) {
178183
179184 var originalCode = code ;
180185
186+ System . debug && console . log ( `[lively.module] runEval: ${ code . slice ( 0 , 100 ) . replace ( / \n / mg, " " ) } ...` ) ;
187+
181188 return Promise . resolve ( )
182189 . then ( ( ) => {
183190 var targetModule = options . targetModule || "*scratch*" ;
@@ -212,11 +219,12 @@ function runEvalWithAsyncSupport(System, code, options) {
212219 transpiler : transpiler
213220 } ) ;
214221
222+ System . debug && console . log ( `[lively.module] runEval in module ${ fullname } started` ) ;
223+
215224 recordDoitRequest (
216225 System , originalCode ,
217226 { waitForPromise : options . waitForPromise , targetModule : options . targetModule } ,
218227 Date . now ( ) ) ;
219-
220228 return realRunEval ( code , options )
221229 . then ( result =>
222230 result . isError || ! env . currentEval . promise ?
@@ -226,13 +234,18 @@ function runEvalWithAsyncSupport(System, code, options) {
226234 } ) )
227235 . then ( result => {
228236 System [ "__lively.modules__" ] . evaluationDone ( fullname ) ;
237+ System . debug && console . log ( `[lively.module] runEval in module ${ targetModule } done` ) ;
229238 recordDoitResult (
230239 System , originalCode ,
231240 { waitForPromise : options . waitForPromise , targetModule : options . targetModule } ,
232241 result , Date . now ( ) ) ;
233242 return result ;
234243 } )
235244 } )
245+ . catch ( err => {
246+ console . error ( `Error in runEval: ${ err . stack } ` ) ;
247+ throw err ;
248+ } )
236249 } ) ;
237250}
238251
0 commit comments