@@ -173,6 +173,19 @@ function createUnsourcemappedFrame(
173
173
}
174
174
}
175
175
176
+ function sourceMapIgnoreListsEverything (
177
+ sourceMap : ModernSourceMapPayload
178
+ ) : boolean {
179
+ if ( 'sections' in sourceMap ) {
180
+ // If sections are present, the ignoreList is not used.
181
+ // This is because sections are used to ignore-list everything.
182
+ return sourceMap . sections . every ( ( section ) => {
183
+ return sourceMapIgnoreListsEverything ( section . map )
184
+ } )
185
+ }
186
+ return sourceMap . sources . length === sourceMap . ignoreList ?. length
187
+ }
188
+
176
189
/**
177
190
* @param frame
178
191
* @param sourceMapCache
@@ -261,6 +274,7 @@ function getSourcemappedFrameIfPossible(
261
274
line : frame . lineNumber ?? 1 ,
262
275
} )
263
276
277
+ let ignored = sourceMapIgnoreListsEverything ( sourceMapPayload )
264
278
if ( sourcePosition . source === null ) {
265
279
return {
266
280
stack : {
@@ -269,7 +283,7 @@ function getSourcemappedFrameIfPossible(
269
283
file : frame . file ,
270
284
lineNumber : frame . lineNumber ,
271
285
methodName : frame . methodName ,
272
- ignored : shouldIgnoreListGeneratedFrame ( frame . file ) ,
286
+ ignored : ignored || shouldIgnoreListGeneratedFrame ( frame . file ) ,
273
287
} ,
274
288
code : null ,
275
289
}
@@ -280,18 +294,17 @@ function getSourcemappedFrameIfPossible(
280
294
sourceMapPayload
281
295
)
282
296
// TODO(veil): Upstream a method to sourcemap consumer that immediately says if a frame is ignored or not.
283
- let ignored = false
284
297
if ( applicableSourceMap === undefined ) {
285
298
console . error ( 'No applicable source map found in sections for frame' , frame )
286
- } else if ( shouldIgnoreListOriginalFrame ( sourcePosition . source ) ) {
299
+ } else if ( ! ignored && shouldIgnoreListOriginalFrame ( sourcePosition . source ) ) {
287
300
// Externals may be libraries that don't ship ignoreLists.
288
301
// This is really taking control away from libraries.
289
302
// They should still ship `ignoreList` so that attached debuggers ignore-list their frames.
290
303
// TODO: Maybe only ignore library sourcemaps if `ignoreList` is absent?
291
304
// Though keep in mind that Turbopack omits empty `ignoreList`.
292
305
// So if we establish this convention, we should communicate it to the ecosystem.
293
306
ignored = true
294
- } else {
307
+ } else if ( ! ignored ) {
295
308
// TODO: O(n^2). Consider moving `ignoreList` into a Set
296
309
const sourceIndex = applicableSourceMap . sources . indexOf (
297
310
sourcePosition . source
0 commit comments