@@ -30,7 +30,6 @@ const resolvedPromise = PromiseResolve();
3030let debug = require ( 'internal/util/debuglog' ) . debuglog ( 'esm' , ( fn ) => {
3131 debug = fn ;
3232} ) ;
33- // const { writeFileSync } = require('fs');
3433
3534const noop = FunctionPrototype ;
3635
@@ -114,21 +113,20 @@ class ModuleJob {
114113 }
115114
116115 async _instantiate ( ) {
117- // writeFileSync(1, 'ModuleJob::instantiate()\n');
118116 const jobsInGraph = new SafeSet ( ) ;
119117 const addJobsToDependencyGraph = async ( moduleJob ) => {
120118 if ( jobsInGraph . has ( moduleJob ) ) {
121119 return ;
122120 }
123121 jobsInGraph . add ( moduleJob ) ;
124- // writeFileSync(1, 'ModuleJob::instantiate() getting linked jobs\n');
122+
125123 const dependencyJobs = await moduleJob . linked ;
126- // writeFileSync(1, 'ModuleJob::instantiate() got linked jobs\n');
124+
127125 return SafePromiseAllReturnVoid ( dependencyJobs , addJobsToDependencyGraph ) ;
128126 } ;
127+
129128 await addJobsToDependencyGraph ( this ) ;
130129
131- // writeFileSync(1, 'ModuleJob::instantiate() job added to dep graph\n');
132130 try {
133131 if ( ! hasPausedEntry && this . inspectBrk ) {
134132 hasPausedEntry = true ;
@@ -138,7 +136,7 @@ class ModuleJob {
138136 this . module . instantiate ( ) ;
139137 }
140138 } catch ( e ) {
141- // writeFileSync(1, `ModuleJob::instantiate() error: ${e.stack}\n`);
139+
142140 decorateErrorStack ( e ) ;
143141 // TODO(@bcoe): Add source map support to exception that occurs as result
144142 // of missing named export. This is currently not possible because
@@ -218,16 +216,14 @@ class ModuleJob {
218216 }
219217
220218 async run ( ) {
221- // writeFileSync(1, `ModuleJob::run() instantiating: ${this.url}\n`);
222219 await this . instantiate ( ) ;
223- // writeFileSync(1, `ModuleJob::run() instantiated: ${this.url}\n`);
224220 const timeout = - 1 ;
225221 const breakOnSigint = false ;
222+
226223 try {
227224 await this . module . evaluate ( timeout , breakOnSigint ) ;
228- // writeFileSync(1, `ModuleJob::run() evaluation complete: ${this.module}\n`);
225+
229226 } catch ( e ) {
230- // writeFileSync(1, `ModuleJob::run() error: ${e.stack}\n`);
231227 if ( e ?. name === 'ReferenceError' &&
232228 isCommonJSGlobalLikeNotDefinedError ( e . message ) ) {
233229 e . message += ' in ES module scope' ;
@@ -249,7 +245,7 @@ class ModuleJob {
249245 'to use the \'.cjs\' file extension.' ;
250246 }
251247 }
252- // writeFileSync(1, `ModuleJob::run() throwing error: ${e.stack}\n`);
248+
253249 throw e ;
254250 }
255251 return { __proto__ : null , module : this . module } ;
0 commit comments