Files
discord-decomp/_bundle/Module923.js
T
2026-11-01 12:12:55 +02:00

109 lines
3.1 KiB
JavaScript

// Metro module 923 (f924).
import { defineIntegration } from "./setupIntegration";
import { GLOBAL_OBJ } from "./Module821";
import { HermesBuiltin } from "../_hermes/prelude";
function $mk67339($env) {
return (a0) => {
if (a0.filename) {
const r10 = /^[a-zA-Z]:\\/.test(a0.filename) || a0.filename.includes("\\") && !a0.filename.includes("/");
L19: {
const r17 = $env;
const r21 = /^\//.test(a0.filename);
if (r17[0]) {
const r46 = r17[1];
if (r46) {
const filename2 = a0.filename;
if (filename2.indexOf(r46) === 0) {
a0.filename = filename2.replace(r46, r17[2]);
}
}
} else {
if (!r10 && !r21) {
break L19;
}
const filename = a0.filename;
const r8 = r10 ? filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : filename;
const r31 = r17[1];
const r32 = $env.$parent;
const r36 = (0, r32[0])(r32[1][2]);
a0.filename = `${r17[2]}${r31 ? r36.relative(r31, r8) : r36.basename(r8)}`;
}
}
return a0;
}
return a0;
};
}
let env758 = {};
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
const r16 = defineIntegration(function(r2 = {}) {
const root = r2.root;
const r5 = r2.prefix || "app:///";
const r0 = "window" in GLOBAL_OBJ && !!GLOBAL_OBJ.window;
let iteratee = r2.iteratee;
if (!iteratee) {
let env12568;
const r19 = env12568 = {
$parent: env758
};
env12568[0] = r0;
env12568[1] = root;
env12568[2] = r5;
iteratee = $mk67339(r19);
}
let c12567_0 = iteratee;
return {
name: "RewriteFrames",
processEvent: (a0) => a0.exception && Array.isArray(a0.exception.values) ? (function _processExceptionsEvent(a0) {
let r1;
try {
r1 = {
...a0,
exception: {
...a0.exception,
values: a0.exception.values.map((value) => {
const r3 = {
...value
};
let stacktrace = value.stacktrace;
if (stacktrace) {
const stacktrace2 = value.stacktrace;
const r2 = stacktrace2 == null;
let frames2 = void 0;
if (!r2) {
const frames = stacktrace2.frames;
frames2 = frames == null ? void 0 : frames.map((frame) => c12567_0(frame));
}
stacktrace = {
stacktrace: {
...stacktrace2,
frames: frames2
}
};
}
HermesBuiltin.copyDataProperties(r3, stacktrace);
return r3;
})
}
};
} catch ($e) {
return a0;
}
return r1;
})(a0) : a0
};
});
export function generateIteratee(a0) {
let env12566;
const r0 = env12566 = {
$parent: env758
};
env12566[0] = a0.isBrowser;
env12566[1] = a0.root;
env12566[2] = a0.prefix;
return $mk67339(r0);
}
export { r16 as rewriteFramesIntegration };