(parser: StackParser)
| 40 | } |
| 41 | |
| 42 | function ensureMetadataStacksAreParsed(parser: StackParser): void { |
| 43 | if (!GLOBAL_OBJ._sentryModuleMetadata) { |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | for (const stack of Object.keys(GLOBAL_OBJ._sentryModuleMetadata)) { |
| 48 | const metadata = GLOBAL_OBJ._sentryModuleMetadata[stack]; |
| 49 | |
| 50 | if (parsedStacks.has(stack)) { |
| 51 | continue; |
| 52 | } |
| 53 | |
| 54 | // Ensure this stack doesn't get parsed again |
| 55 | parsedStacks.add(stack); |
| 56 | |
| 57 | const frames = parser(stack); |
| 58 | |
| 59 | // Go through the frames starting from the top of the stack and find the first one with a filename |
| 60 | for (const frame of frames.reverse()) { |
| 61 | if (frame.filename) { |
| 62 | // Save the metadata for this filename |
| 63 | filenameMetadataMap.set(frame.filename, metadata); |
| 64 | break; |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Retrieve metadata for a specific JavaScript file URL. |
no test coverage detected