@@ -867,15 +867,15 @@ namespace ts {
867
867
forEachResolvedProjectReference
868
868
} ) ;
869
869
870
- tracing . begin ( tracing . Phase . Program , "shouldProgramCreateNewSourceFiles" , { hasOldProgram : ! ! oldProgram } ) ;
870
+ tracing . push ( tracing . Phase . Program , "shouldProgramCreateNewSourceFiles" , { hasOldProgram : ! ! oldProgram } ) ;
871
871
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles ( oldProgram , options ) ;
872
- tracing . end ( ) ;
872
+ tracing . pop ( ) ;
873
873
// We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks
874
874
// `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`.
875
875
let structureIsReused : StructureIsReused ;
876
- tracing . begin ( tracing . Phase . Program , "tryReuseStructureFromOldProgram" , { } ) ;
876
+ tracing . push ( tracing . Phase . Program , "tryReuseStructureFromOldProgram" , { } ) ;
877
877
structureIsReused = tryReuseStructureFromOldProgram ( ) ; // eslint-disable-line prefer-const
878
- tracing . end ( ) ;
878
+ tracing . pop ( ) ;
879
879
if ( structureIsReused !== StructureIsReused . Completely ) {
880
880
processingDefaultLibFiles = [ ] ;
881
881
processingOtherFiles = [ ] ;
@@ -911,23 +911,23 @@ namespace ts {
911
911
}
912
912
}
913
913
914
- tracing . begin ( tracing . Phase . Program , "processRootFiles" , { count : rootNames . length } ) ;
914
+ tracing . push ( tracing . Phase . Program , "processRootFiles" , { count : rootNames . length } ) ;
915
915
forEach ( rootNames , name => processRootFile ( name , /*isDefaultLib*/ false , /*ignoreNoDefaultLib*/ false ) ) ;
916
- tracing . end ( ) ;
916
+ tracing . pop ( ) ;
917
917
918
918
// load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders
919
919
const typeReferences : string [ ] = rootNames . length ? getAutomaticTypeDirectiveNames ( options , host ) : emptyArray ;
920
920
921
921
if ( typeReferences . length ) {
922
- tracing . begin ( tracing . Phase . Program , "processTypeReferences" , { count : typeReferences . length } ) ;
922
+ tracing . push ( tracing . Phase . Program , "processTypeReferences" , { count : typeReferences . length } ) ;
923
923
// This containingFilename needs to match with the one used in managed-side
924
924
const containingDirectory = options . configFilePath ? getDirectoryPath ( options . configFilePath ) : host . getCurrentDirectory ( ) ;
925
925
const containingFilename = combinePaths ( containingDirectory , inferredTypesContainingFile ) ;
926
926
const resolutions = resolveTypeReferenceDirectiveNamesWorker ( typeReferences , containingFilename ) ;
927
927
for ( let i = 0 ; i < typeReferences . length ; i ++ ) {
928
928
processTypeReferenceDirective ( typeReferences [ i ] , resolutions [ i ] ) ;
929
929
}
930
- tracing . end ( ) ;
930
+ tracing . pop ( ) ;
931
931
}
932
932
933
933
// Do not process the default library if:
@@ -1049,25 +1049,25 @@ namespace ts {
1049
1049
if ( ! moduleNames . length ) return emptyArray ;
1050
1050
const containingFileName = getNormalizedAbsolutePath ( containingFile . originalFileName , currentDirectory ) ;
1051
1051
const redirectedReference = getRedirectReferenceForResolution ( containingFile ) ;
1052
- tracing . begin ( tracing . Phase . Program , "resolveModuleNamesWorker" , { containingFileName } ) ;
1052
+ tracing . push ( tracing . Phase . Program , "resolveModuleNamesWorker" , { containingFileName } ) ;
1053
1053
performance . mark ( "beforeResolveModule" ) ;
1054
1054
const result = actualResolveModuleNamesWorker ( moduleNames , containingFileName , reusedNames , redirectedReference ) ;
1055
1055
performance . mark ( "afterResolveModule" ) ;
1056
1056
performance . measure ( "ResolveModule" , "beforeResolveModule" , "afterResolveModule" ) ;
1057
- tracing . end ( ) ;
1057
+ tracing . pop ( ) ;
1058
1058
return result ;
1059
1059
}
1060
1060
1061
1061
function resolveTypeReferenceDirectiveNamesWorker ( typeDirectiveNames : string [ ] , containingFile : string | SourceFile ) : readonly ( ResolvedTypeReferenceDirective | undefined ) [ ] {
1062
1062
if ( ! typeDirectiveNames . length ) return [ ] ;
1063
1063
const containingFileName = ! isString ( containingFile ) ? getNormalizedAbsolutePath ( containingFile . originalFileName , currentDirectory ) : containingFile ;
1064
1064
const redirectedReference = ! isString ( containingFile ) ? getRedirectReferenceForResolution ( containingFile ) : undefined ;
1065
- tracing . begin ( tracing . Phase . Program , "resolveTypeReferenceDirectiveNamesWorker" , { containingFileName } ) ;
1065
+ tracing . push ( tracing . Phase . Program , "resolveTypeReferenceDirectiveNamesWorker" , { containingFileName } ) ;
1066
1066
performance . mark ( "beforeResolveTypeReference" ) ;
1067
1067
const result = actualResolveTypeReferenceDirectiveNamesWorker ( typeDirectiveNames , containingFileName , redirectedReference ) ;
1068
1068
performance . mark ( "afterResolveTypeReference" ) ;
1069
1069
performance . measure ( "ResolveTypeReference" , "beforeResolveTypeReference" , "afterResolveTypeReference" ) ;
1070
- tracing . end ( ) ;
1070
+ tracing . pop ( ) ;
1071
1071
return result ;
1072
1072
}
1073
1073
@@ -2438,13 +2438,13 @@ namespace ts {
2438
2438
2439
2439
// Get source file from normalized fileName
2440
2440
function findSourceFile ( fileName : string , path : Path , isDefaultLib : boolean , ignoreNoDefaultLib : boolean , refFile : RefFile | undefined , packageId : PackageId | undefined ) : SourceFile | undefined {
2441
- tracing . begin ( tracing . Phase . Program , "findSourceFile" , {
2441
+ tracing . push ( tracing . Phase . Program , "findSourceFile" , {
2442
2442
fileName,
2443
2443
isDefaultLib : isDefaultLib || undefined ,
2444
2444
refKind : refFile ? ( RefFileKind as any ) [ refFile . kind ] : undefined ,
2445
2445
} ) ;
2446
2446
const result = findSourceFileWorker ( fileName , path , isDefaultLib , ignoreNoDefaultLib , refFile , packageId ) ;
2447
- tracing . end ( ) ;
2447
+ tracing . pop ( ) ;
2448
2448
return result ;
2449
2449
}
2450
2450
@@ -2773,9 +2773,9 @@ namespace ts {
2773
2773
resolvedTypeReferenceDirective ?: ResolvedTypeReferenceDirective ,
2774
2774
refFile ?: RefFile
2775
2775
) : void {
2776
- tracing . begin ( tracing . Phase . Program , "processTypeReferenceDirective" , { directive : typeReferenceDirective , hasResolved : ! ! resolveModuleNamesReusingOldState , refKind : refFile ?. kind , refPath : refFile ?. file . path } ) ;
2776
+ tracing . push ( tracing . Phase . Program , "processTypeReferenceDirective" , { directive : typeReferenceDirective , hasResolved : ! ! resolveModuleNamesReusingOldState , refKind : refFile ?. kind , refPath : refFile ?. file . path } ) ;
2777
2777
processTypeReferenceDirectiveWorker ( typeReferenceDirective , resolvedTypeReferenceDirective , refFile ) ;
2778
- tracing . end ( ) ;
2778
+ tracing . pop ( ) ;
2779
2779
}
2780
2780
2781
2781
function processTypeReferenceDirectiveWorker (
0 commit comments