@@ -771,12 +771,12 @@ export default class Module {
771771 this . transformDependencies = transformDependencies ;
772772 this . customTransformCache = customTransformCache ;
773773 this . updateOptions ( moduleOptions ) ;
774- const moduleAst = ast || this . tryParse ( ) ;
774+ const moduleAst = ast ?? this . tryParse ( ) ;
775775
776776 timeEnd ( 'generate ast' , 3 ) ;
777777 timeStart ( 'analyze ast' , 3 ) ;
778778
779- this . resolvedIds = resolvedIds || Object . create ( null ) ;
779+ this . resolvedIds = resolvedIds ?? Object . create ( null ) ;
780780
781781 // By default, `id` is the file name. Custom resolvers and loaders
782782 // can change that, but it makes sense to use it for the source file name
@@ -910,14 +910,6 @@ export default class Module {
910910 return null ;
911911 }
912912
913- tryParse ( ) : acorn . Node {
914- try {
915- return this . graph . contextParse ( this . info . code ! ) ;
916- } catch ( error_ : any ) {
917- return this . error ( errorParseError ( error_ , this . id ) , error_ . pos ) ;
918- }
919- }
920-
921913 updateOptions ( {
922914 meta,
923915 moduleSideEffects,
@@ -1259,6 +1251,14 @@ export default class Module {
12591251 this . options . onwarn ( errorShimmedExport ( this . id , name ) ) ;
12601252 this . exports . set ( name , MISSING_EXPORT_SHIM_DESCRIPTION ) ;
12611253 }
1254+
1255+ private tryParse ( ) : acorn . Node {
1256+ try {
1257+ return this . graph . contextParse ( this . info . code ! ) ;
1258+ } catch ( error_ : any ) {
1259+ return this . error ( errorParseError ( error_ , this . id ) , error_ . pos ) ;
1260+ }
1261+ }
12621262}
12631263
12641264// if there is a cyclic import in the reexport chain, we should not
0 commit comments