46 lines
1.6 KiB
JavaScript
46 lines
1.6 KiB
JavaScript
// Metro module 1086 (f1087).
|
|
import { defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment, addContextToFrame } from "./Module817";
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
const r16 = defineIntegration(function(r3 = {}) {
|
|
const frameContextLines = r3.frameContextLines != null ? r3.frameContextLines : 7;
|
|
return {
|
|
name: "ContextLines",
|
|
processEvent: (a0) => {
|
|
let c24043_2;
|
|
const frameContextLines2 = frameContextLines;
|
|
const document2 = GLOBAL_OBJ.document;
|
|
const r22 = GLOBAL_OBJ.location && stripUrlQueryAndFragment(GLOBAL_OBJ.location.href);
|
|
let c24043_1 = r22;
|
|
if (document2 && r22) {
|
|
const values = a0.exception?.values;
|
|
if (values?.length) {
|
|
const innerHTML = document2.documentElement.innerHTML;
|
|
if (innerHTML) {
|
|
c24043_2 = ["<!DOCTYPE html>", "<html>", ...innerHTML.split("\n"), "</html>"];
|
|
values.forEach(({ stacktrace }) => {
|
|
if (stacktrace?.frames) {
|
|
stacktrace.frames = stacktrace.frames.map((frame) => {
|
|
if (frame.filename === c24043_1 && frame.lineno && c24043_2.length) {
|
|
addContextToFrame(c24043_2, frame, frameContextLines2);
|
|
}
|
|
return frame;
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
return a0;
|
|
}
|
|
};
|
|
});
|
|
export function applySourceContextToFrame(a0, a1, a2, a3) {
|
|
if (a0.filename === a2 && a0.lineno && a1.length) {
|
|
addContextToFrame(a1, a0, a3);
|
|
}
|
|
return a0;
|
|
}
|
|
export { r16 as contextLinesIntegration };
|