350 lines
16 KiB
JavaScript
350 lines
16 KiB
JavaScript
/* Metro module 1039; source: unknown; dependencies: [826] */
|
|
import * as moduleValue22 from './module-00826.js'; /* Metro dependency 826 */
|
|
|
|
function _fun11030(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#11030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:6, offset: 0x00d9ed46, size: 223 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const exceptionFromError_110312 = exceptionFromError_11031;
|
|
const isWebAssemblyException = function(a0) {
|
|
return typeof global.WebAssembly !== 'undefined' && global.WebAssembly.Exception !== undefined && a0 instanceof global.WebAssembly.Exception;
|
|
};
|
|
const extractType2 = extractType;
|
|
const extractMessage2 = extractMessage;
|
|
const eventFromUnknownInput_110382 = eventFromUnknownInput_11038;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
const env0_2 = RegExp('Minified React error #\\d+;', 'i');
|
|
exports.eventFromException = eventFromException;
|
|
exports.eventFromMessage = eventFromMessage_11042;
|
|
exports.eventFromUnknownInput = eventFromUnknownInput_110382;
|
|
exports.exceptionFromError = exceptionFromError_110312;
|
|
exports.extractMessage = extractMessage2;
|
|
exports.extractType = extractType2;
|
|
function exceptionFromError_11031(a0, a1) { // fn#11031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:30, offset: 0x00d9ee25, size: 112 bytes, params: 3, frame: 15
|
|
var r1;
|
|
const stackFrames_11034 = parseStackFrames_11034(a0, a1);
|
|
const object = {};
|
|
object.type = extractType(a1);
|
|
object.value = extractMessage(a1);
|
|
if (stackFrames_11034.length) {
|
|
object.stacktrace = {frames: stackFrames_11034};
|
|
}
|
|
let value = object.type === undefined;
|
|
if (value) {
|
|
value = object.value;
|
|
value = value === '';
|
|
r1 = value;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
if (r1) {
|
|
object.value = 'Unrecoverable error caught';
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function eventFromPlainObject(a0, a1, a2, a3) { // fn#11032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:254, offset: 0x00d9ee95, size: 396 bytes, params: 5, frame: 28
|
|
var r14;
|
|
var r4;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var Object;
|
|
var prototype;
|
|
var hasOwnProperty;
|
|
var call;
|
|
var property;
|
|
var Error;
|
|
var stackFrames_11034;
|
|
const value2 = undefined;
|
|
const client = (require(826) /* metro dependency 826 */).getClient();
|
|
const normalizeDepth = client == null ? value2 : client.getOptions().normalizeDepth;
|
|
const properties = Object.keys(a1);
|
|
const properties2 = 0;
|
|
const properties3 = properties.length;
|
|
if (properties === value2) {
|
|
r4 = value2;
|
|
} else {
|
|
r14 = properties2;
|
|
while (true) {
|
|
propertyName = properties[r14];
|
|
propertyName2 = r14 + 1;
|
|
if (propertyName === value2) {
|
|
r4 = value2;
|
|
break;
|
|
}
|
|
Object = global.Object;
|
|
prototype = Object.prototype;
|
|
hasOwnProperty = prototype.hasOwnProperty;
|
|
call = hasOwnProperty.call;
|
|
if (Reflect.apply(call, hasOwnProperty, [a1, propertyName])) {
|
|
property = a1[propertyName];
|
|
Error = global.Error;
|
|
if (property instanceof Error) {
|
|
r4 = property;
|
|
break;
|
|
}
|
|
r14 = propertyName2;
|
|
continue;
|
|
}
|
|
r14 = propertyName2;
|
|
continue;
|
|
}
|
|
}
|
|
const object = {};
|
|
object.__serialized__ = (require(826) /* metro dependency 826 */).normalizeToSize(a1, normalizeDepth);
|
|
const object2 = {};
|
|
const object3 = {};
|
|
if (r4) {
|
|
object3.values = [exceptionFromError_11031(a0, r4)];
|
|
object2.exception = object3;
|
|
object2.extra = object;
|
|
} else {
|
|
var object4 = {};
|
|
var moduleValue3 = require(826) /* metro dependency 826 */;
|
|
object4.type = moduleValue3.isEvent(a1) ? a1.constructor.name : a3 ? 'UnhandledRejection' : 'Error';
|
|
object4.value = getNonErrorObjectExceptionValue(a1, {isUnhandledRejection: a3});
|
|
object3.values = [object4];
|
|
object2.exception = object3;
|
|
object2.extra = object;
|
|
if (a2) {
|
|
stackFrames_11034 = parseStackFrames_11034(a0, a2);
|
|
if (stackFrames_11034.length) {
|
|
object2.exception.values[0].stacktrace = {frames: stackFrames_11034};
|
|
}
|
|
}
|
|
}
|
|
return object2;
|
|
}
|
|
|
|
function eventFromError(a0, a1) { // fn#11033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:913, offset: 0x00d9f021, size: 44 bytes, params: 3, frame: 15
|
|
const object2 = {};
|
|
object2.values = [exceptionFromError_11031(a0, a1)];
|
|
return {exception: object2};
|
|
}
|
|
|
|
function parseStackFrames_11034(a0, a1) { // fn#11034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:995, offset: 0x00d9f04d, size: 122 bytes, params: 3, frame: 21
|
|
var error;
|
|
let r5 = a1.stacktrace || a1.stack;
|
|
r5 = !r5 ? '' : r5;
|
|
let value = 0;
|
|
const r7 = a1 && env0_2.test(a1.message) ? 1 : value;
|
|
let framesToPop = a1.framesToPop;
|
|
framesToPop = typeof framesToPop !== 'number' ? value : a1.framesToPop;
|
|
try {
|
|
value = a0(r5, r7, framesToPop);
|
|
} catch (error) {
|
|
return [];
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function extractType(a0) { // fn#11036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:1527, offset: 0x00d9f107, size: 130 bytes, params: 2, frame: 15
|
|
const name = a0?.name;
|
|
return name || (isWebAssemblyException(a0) ? a0.message && global.Array.isArray(a0.message) && a0.message.length == 2 ? a0.message[0] : 'WebAssembly.Exception' : name);
|
|
}
|
|
|
|
function extractMessage(a0) { // fn#11037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:1711, offset: 0x00d9f189, size: 221 bytes, params: 2, frame: 16
|
|
var r1;
|
|
var r0;
|
|
var Array;
|
|
let value = undefined;
|
|
const message = a0 == null ? value : a0.message;
|
|
if (isWebAssemblyException(a0)) {
|
|
Array = global.Array;
|
|
r0 = Array.isArray(a0.message) && a0.message.length == 2 ? a0.message[1] : 'wasm exception';
|
|
} else if (message) {
|
|
if (message.error) {
|
|
if (typeof message.error.message === 'string') {
|
|
value = require(826) /* metro dependency 826 */;
|
|
value = value._INTERNAL_enhanceErrorWithSentryInfo(message.error);
|
|
r1 = value;
|
|
} else {
|
|
value = require(826) /* metro dependency 826 */;
|
|
value = value._INTERNAL_enhanceErrorWithSentryInfo(a0);
|
|
r1 = value;
|
|
}
|
|
} else {
|
|
value = require(826) /* metro dependency 826 */;
|
|
value = value._INTERNAL_enhanceErrorWithSentryInfo(a0);
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = 'No error message';
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function eventFromUnknownInput_11038(a0, a1, a2, a3, a4) { // fn#11038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:2043, offset: 0x00d9f266, size: 682 bytes, params: 6, frame: 25
|
|
var r4;
|
|
var r12;
|
|
var r7;
|
|
var moduleValue3;
|
|
var moduleValue4;
|
|
var moduleValue5;
|
|
var moduleValue6;
|
|
var value2;
|
|
var value3;
|
|
var value7;
|
|
var Object;
|
|
var value;
|
|
const moduleValue = require(826) /* metro dependency 826 */;
|
|
if (moduleValue.isErrorEvent(a1)) {
|
|
if (a1.error) {
|
|
return eventFromError(a0, a1.error);
|
|
}
|
|
}
|
|
const moduleValue2 = moduleValue;
|
|
if (moduleValue2.isDOMError(a1)) {
|
|
if ('stack' in a1) {
|
|
r4 = eventFromError(a0, a1);
|
|
} else {
|
|
r12 = a1.name || (moduleValue.isDOMError(a1) ? 'DOMError' : 'DOMException');
|
|
r7 = a1.message ? '' + r12 + ': ' + a1.message : r12;
|
|
value7 = eventFromString(a0, r7, a2, a3);
|
|
(require(826) /* metro dependency 826 */).addExceptionTypeValue(value7, r7);
|
|
r4 = value7;
|
|
}
|
|
if ('code' in a1) {
|
|
Object = global.Object;
|
|
r4.tags = Object.assign({}, r4.tags, {['DOMException.code']: '' + a1.code});
|
|
}
|
|
} else {
|
|
moduleValue3 = require(826) /* metro dependency 826 */;
|
|
if (moduleValue3.isDOMException(a1)) {
|
|
if ('stack' in a1) {
|
|
r4 = eventFromError(a0, a1);
|
|
} else {
|
|
r12 = a1.name || ((require(826) /* metro dependency 826 */).isDOMError(a1) ? 'DOMError' : 'DOMException');
|
|
r7 = a1.message ? '' + r12 + ': ' + a1.message : r12;
|
|
value7 = eventFromString(a0, r7, a2, a3);
|
|
(require(826) /* metro dependency 826 */).addExceptionTypeValue(value7, r7);
|
|
r4 = value7;
|
|
}
|
|
if ('code' in a1) {
|
|
Object = global.Object;
|
|
r4.tags = Object.assign({}, r4.tags, {['DOMException.code']: '' + a1.code});
|
|
}
|
|
return r4;
|
|
}
|
|
moduleValue4 = require(826) /* metro dependency 826 */;
|
|
if (moduleValue4.isError(a1)) {
|
|
r4 = eventFromError(a0, a1);
|
|
} else {
|
|
moduleValue5 = require(826) /* metro dependency 826 */;
|
|
if (moduleValue5.isPlainObject(a1)) {
|
|
value3 = eventFromPlainObject(a0, a1, a2, a4);
|
|
(require(826) /* metro dependency 826 */).addExceptionMechanism(value3, {synthetic: true});
|
|
r4 = value3;
|
|
} else {
|
|
moduleValue6 = require(826) /* metro dependency 826 */;
|
|
if (moduleValue6.isEvent(a1)) {
|
|
value3 = eventFromPlainObject(a0, a1, a2, a4);
|
|
(require(826) /* metro dependency 826 */).addExceptionMechanism(value3, {synthetic: true});
|
|
r4 = value3;
|
|
} else {
|
|
value2 = eventFromString(a0, a1, a2, a3);
|
|
value = require(826) /* metro dependency 826 */;
|
|
value.addExceptionTypeValue(value2, '' + a1, undefined);
|
|
value = require(826) /* metro dependency 826 */;
|
|
value.addExceptionMechanism(value2, {synthetic: true});
|
|
r4 = value2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return r4;
|
|
}
|
|
|
|
function eventFromString(a0, a1, a2, a3) { // fn#11039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:2813, offset: 0x00d9f510, size: 198 bytes, params: 5, frame: 17
|
|
var stackFrames_11034;
|
|
const object = {};
|
|
if (a3) {
|
|
if (a2) {
|
|
stackFrames_11034 = parseStackFrames_11034(a0, a2);
|
|
if (stackFrames_11034.length) {
|
|
object.exception = {values: [{value: a1, stacktrace: {frames: stackFrames_11034}}]};
|
|
}
|
|
(require(826) /* metro dependency 826 */).addExceptionMechanism(object, {synthetic: true});
|
|
}
|
|
}
|
|
const value = require(826) /* metro dependency 826 */;
|
|
if (value.isParameterizedString(a1)) {
|
|
object.logentry = {message: a1.__sentry_template_string__, params: a1.__sentry_template_values__};
|
|
} else {
|
|
object.message = a1;
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function getNonErrorObjectExceptionValue(a0, {isUnhandledRejection}) { // fn#11040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:3173, offset: 0x00d9f5d6, size: 298 bytes, params: 3, frame: 21
|
|
var name;
|
|
var r0;
|
|
var Object;
|
|
var constructor;
|
|
var error;
|
|
var value;
|
|
const value3 = (moduleValue22).extractExceptionKeysForMessage(a0);
|
|
const r6 = isUnhandledRejection ? 'promise rejection' : 'exception';
|
|
if (moduleValue22.isErrorEvent(a0)) {
|
|
r0 = 'Event `ErrorEvent` captured as ' + r6 + ' with message `' + a0.message + '`';
|
|
} else {
|
|
value = moduleValue22;
|
|
if (value.isEvent(a0)) {
|
|
try {
|
|
Object = global.Object;
|
|
value = Object.getPrototypeOf(a0);
|
|
if (value) {
|
|
constructor = value.constructor;
|
|
name = constructor.name;
|
|
} else {
|
|
name = undefined;
|
|
}
|
|
} catch (error) {
|
|
name = undefined;
|
|
}
|
|
value = 'Event `' + name + '` (type=' + a0.type + ') captured as ' + r6;
|
|
r0 = value;
|
|
} else {
|
|
r0 = 'Object captured as ' + r6 + ' with keys: ' + value3;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function eventFromException(a0, a1, a2, a3) { // fn#11041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:3676, offset: 0x00d9f700, size: 150 bytes, params: 5, frame: 20
|
|
const eventFromUnknownInput_11038Binding = eventFromUnknownInput_11038;
|
|
const value2 = undefined;
|
|
let syntheticException = a2 == null ? value2 : a2.syntheticException;
|
|
syntheticException = !syntheticException ? value2 : syntheticException;
|
|
const value3 = eventFromUnknownInput_11038Binding(a0, a1, syntheticException, a3);
|
|
(moduleValue22).addExceptionMechanism(value3);
|
|
value3.level = 'error';
|
|
if (a2 != null && a2.event_id) {
|
|
value3.event_id = a2.event_id;
|
|
}
|
|
return (moduleValue22).resolvedSyncPromise(value3);
|
|
}
|
|
|
|
function eventFromMessage_11042(a0, a1) { // fn#11042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1166:3946, offset: 0x00d9f796, size: 190 bytes, params: 3, frame: 21
|
|
const value = undefined;
|
|
const value2 = 'info';
|
|
const r5 = arguments.length > 2 ? value === arguments[2] ? value2 : arguments[2] : value2;
|
|
const r1 = arguments.length > 3 ? arguments[3] : value;
|
|
const r9 = arguments.length > 4 ? arguments[4] : value;
|
|
const eventFromStringBinding = eventFromString;
|
|
let syntheticException = r1 == null ? value : r1.syntheticException;
|
|
syntheticException = !syntheticException ? value : syntheticException;
|
|
const value7 = eventFromStringBinding(a0, a1, syntheticException, r9);
|
|
value7.level = r5;
|
|
if (r1 != null && r1.event_id) {
|
|
value7.event_id = r1.event_id;
|
|
}
|
|
return (moduleValue22).resolvedSyncPromise(value7);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun11030, 1039, [826]) /* metro module 1039, dependencies: [826] */;
|