/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at . */
import { getLibraryFromUrl } from "./getLibraryFromUrl";
/**
* Augment all frame objects with a 'library' attribute.
*/
export function annotateFramesWithLibrary(frames) {
for (const frame of frames) {
frame.library = getLibraryFromUrl(frame, frames);
}
// Babel need some special treatment to recognize some particular async stack pattern
for (const idx of getBabelFrameIndexes(frames)) {
const frame = frames[idx];
frame.library = "Babel";
}
}
/**
* Returns all the indexes that are part of a babel async call stack.
*
* @param {Array