Skip to content

Commit efd10bf

Browse files
committed
Ensure libs are traced in guaranteed order
1 parent 176a63f commit efd10bf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/compiler/fileloader.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ func processAllProgramFiles(
206206
}
207207
}
208208

209-
loader.pathForLibFileResolutions.Range(func(key tspath.Path, value *libResolution) bool {
209+
keys := slices.Collect(loader.pathForLibFileResolutions.Keys())
210+
slices.Sort(keys)
211+
for _, key := range keys {
212+
value, _ := loader.pathForLibFileResolutions.Load(key)
210213
resolvedModules[key] = module.ModeAwareCache[*module.ResolvedModule]{
211214
module.ModeAwareCacheKey{Name: value.libraryName, Mode: core.ModuleKindCommonJS}: value.resolution,
212215
}
@@ -216,8 +219,7 @@ func processAllProgramFiles(
216219
for _, diag := range value.resolution.ResolutionDiagnostics {
217220
fileLoadDiagnostics.Add(diag)
218221
}
219-
return true
220-
})
222+
}
221223

222224
return processedFiles{
223225
resolver: loader.resolver,

0 commit comments

Comments
 (0)