233 lines
9.6 KiB
React
233 lines
9.6 KiB
React
/* Metro module 1086; source: unknown; dependencies: [826, 1036, 1039, 1080] */
|
|
function _fun11326(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#11326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:6, offset: 0x00da95fd, size: 148 bytes, params: 8, frame: 21
|
|
let env0_0 = require;
|
|
const closure = _getUnhandledRejectionError;
|
|
const closure2 = function(a0) {
|
|
var object3 = {type: 'UnhandledRejection'};
|
|
object3.value = 'Non-Error promise rejection captured with value: ' + (0, global.String)(a0);
|
|
return {exception: {values: [object3]}};
|
|
};
|
|
const globalHandlerLog = function(a0) {
|
|
if (require(dependencyMap[3]).DEBUG_BUILD) {
|
|
require(dependencyMap[0]).debug.log('Global Handler attached: ' + a0);
|
|
}
|
|
};
|
|
let Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
let value = require(826) /* metro dependency 826 */;
|
|
value = value.defineIntegration(function() {
|
|
var r4;
|
|
r4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
var Object = global.Object;
|
|
var env0_0 = Object.assign({'onerror': true, 'onunhandledrejection': true}, r4);
|
|
return {name: 'GlobalHandlers', setupOnce: _fun11333, setup: _fun11334};
|
|
});
|
|
exports._eventFromRejectionWithPrimitive = closure2;
|
|
exports._getUnhandledRejectionError = closure;
|
|
exports.globalHandlersIntegration = value;
|
|
}
|
|
|
|
function _getUnhandledRejectionError(a0) { // fn#11327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:2001, offset: 0x00da9691, size: 124 bytes, params: 2, frame: 13
|
|
var detail;
|
|
var reason;
|
|
var error;
|
|
var value;
|
|
if (!Reflect.apply((require(826) /* metro dependency 826 */).isPrimitive, value, [a0])) {
|
|
try {
|
|
value = 'reason' in a0;
|
|
} catch (error) {
|
|
return a0;
|
|
}
|
|
if (value) {
|
|
try {
|
|
reason = a0.reason;
|
|
} catch (error) {
|
|
return a0;
|
|
}
|
|
return reason;
|
|
}
|
|
try {
|
|
value = 'detail' in a0;
|
|
} catch (error) {
|
|
return a0;
|
|
}
|
|
if (value) {
|
|
try {
|
|
detail = a0.detail;
|
|
} catch (error) {
|
|
return a0;
|
|
}
|
|
try {
|
|
value = 'reason' in detail;
|
|
} catch (error) {
|
|
return a0;
|
|
}
|
|
if (value) {
|
|
try {
|
|
detail = a0.detail;
|
|
reason = detail.reason;
|
|
} catch (error) {
|
|
return a0;
|
|
}
|
|
return reason;
|
|
}
|
|
return a0;
|
|
}
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function getOptions() { // fn#11330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:2464, offset: 0x00da97bf, size: 82 bytes, params: 1, frame: 11
|
|
const value = undefined;
|
|
const client = (require(826) /* metro dependency 826 */).getClient();
|
|
let r0 = client == null ? value : client.getOptions();
|
|
r0 = !r0 ? {stackParser: function() {
|
|
return [];
|
|
}, attachStacktrace: false} : r0;
|
|
return r0;
|
|
}
|
|
|
|
function _globalHandlersIntegration() { // fn#11332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:126, offset: 0x00da9811, size: 98 bytes, params: 1, frame: 14
|
|
const r4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
const Object = global.Object;
|
|
const env0_0 = Object.assign({'onerror': true, 'onunhandledrejection': true}, r4);
|
|
return {name: 'GlobalHandlers', setupOnce: function() {
|
|
global.Error.stackTraceLimit = 50;
|
|
}, setup: setup_11334};
|
|
}
|
|
|
|
function _globalHandlersIntegrationSetup(a0) { // fn#11334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:376, owner: _globalHandlersIntegration.setup, offset: 0x00da988a, size: 94 bytes, params: 2, frame: 14
|
|
var environment;
|
|
var value2;
|
|
if (env0_0.onerror) {
|
|
_installGlobalOnErrorHandler(a0);
|
|
value2 = environment.__proto__;
|
|
globalHandlerLog('onerror');
|
|
}
|
|
if (env0_0.onunhandledrejection) {
|
|
_installGlobalOnUnhandledRejectionHandler(a0);
|
|
value = environment.__proto__;
|
|
globalHandlerLog('onunhandledrejection');
|
|
}
|
|
}
|
|
|
|
function _installGlobalOnErrorHandler(a0) { // fn#11335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:407, owner: _globalHandlersIntegration.setup._installGlobalOnErrorHandler, offset: 0x00da98e8, size: 51 bytes, params: 2, frame: 12
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const value = environment.__proto__.__proto__;
|
|
(require(826) /* metro dependency 826 */).addGlobalErrorInstrumentationHandler(_fun11336);
|
|
}
|
|
|
|
function _installGlobalOnUnhandledRejectionHandler(a0) { // fn#11338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:1418, owner: _globalHandlersIntegration.setup._installGlobalOnUnhandledRejectionHandler, offset: 0x00da9b7f, size: 51 bytes, params: 2, frame: 12
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const value = environment.__proto__.__proto__;
|
|
(require(826) /* metro dependency 826 */).addGlobalUnhandledRejectionInstrumentationHandler(_fun11339);
|
|
}
|
|
|
|
function _fun11336(a0) { // fn#11336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:494, offset: 0x00da991b, size: 278 bytes, params: 2, frame: 26
|
|
var environment;
|
|
var moduleValue2;
|
|
var msg;
|
|
var url;
|
|
var line;
|
|
var column;
|
|
var error;
|
|
var moduleValue3;
|
|
var value5;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const options = getOptions();
|
|
if ((require(826) /* metro dependency 826 */).getClient() === env0_0) {
|
|
moduleValue2 = require(1036) /* metro dependency 1036 */;
|
|
if (!moduleValue2.shouldIgnoreOnError()) {
|
|
msg = a0.msg;
|
|
url = a0.url;
|
|
line = a0.line;
|
|
column = a0.column;
|
|
error = a0.error;
|
|
moduleValue3 = require(1039) /* metro dependency 1039 */;
|
|
value5 = moduleValue3.eventFromUnknownInput(options.stackParser, error || msg, undefined,
|
|
options.attachStacktrace,
|
|
false);
|
|
_enhanceEventWithInitialFrame(value5, url, line, column);
|
|
value5.level = 'error';
|
|
value = require(826) /* metro dependency 826 */;
|
|
value.captureEvent(value5, {originalException: error, mechanism: {'handled': false,
|
|
'type': 'auto.browser.global_handlers.onerror'}});
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun11339(a0) { // fn#11339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:1531, offset: 0x00da9bb2, size: 271 bytes, params: 2, frame: 21
|
|
var r4;
|
|
var moduleValue2;
|
|
var value5;
|
|
var moduleValue3;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const options = getOptions();
|
|
if ((require(826) /* metro dependency 826 */).getClient() === env0_0) {
|
|
moduleValue2 = require(1036) /* metro dependency 1036 */;
|
|
if (!moduleValue2.shouldIgnoreOnError()) {
|
|
value5 = _getUnhandledRejectionError(a0);
|
|
moduleValue3 = require(826) /* metro dependency 826 */;
|
|
r4 = moduleValue3.isPrimitive(value5) ? _eventFromRejectionWithPrimitive(value5) : (require(1039) /* metro dependency 1039 */).eventFromUnknownInput(options.stackParser,
|
|
|
|
|
|
value5, undefined, options.attachStacktrace, true);
|
|
r4.level = 'error';
|
|
value = require(826) /* metro dependency 826 */;
|
|
value.captureEvent(r4, {originalException: value5, mechanism: {'handled': false,
|
|
'type': 'auto.browser.global_handlers.onunhandledrejection'}});
|
|
}
|
|
}
|
|
}
|
|
|
|
function _enhanceEventWithInitialFrame(a0, a1, a2, a3) { // fn#11337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1213:674, offset: 0x00da9a31, size: 334 bytes, params: 5, frame: 19
|
|
var r5;
|
|
var object2;
|
|
var push;
|
|
let value = a1;
|
|
let r2 = a0.exception || ({});
|
|
a0.exception = r2;
|
|
let r1 = r2.values || [];
|
|
r2.values = r1;
|
|
r2 = r1[0] || ({});
|
|
r1[0] = r2;
|
|
r1 = r2.stacktrace || ({});
|
|
r2.stacktrace = r1;
|
|
const r3 = r1.frames || [];
|
|
r1.frames = r3;
|
|
const value3 = undefined;
|
|
const moduleValue = require(826) /* metro dependency 826 */;
|
|
if (moduleValue.isString(value)) {
|
|
if (value.length === 0) {
|
|
r5 = value3;
|
|
} else if (value.startsWith('data:')) {
|
|
value = moduleValue.stripDataUrlContent(value, false);
|
|
value = '<' + value + '>';
|
|
r5 = value;
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
} else {
|
|
r5 = value3;
|
|
}
|
|
if (r5 == null) {
|
|
value = moduleValue;
|
|
value = value.getLocationHref();
|
|
r5 = value;
|
|
}
|
|
if (r3.length === 0) {
|
|
push = r3.push;
|
|
object2 = {colno: a3, filename: r5};
|
|
object2.function = moduleValue.UNKNOWN_FUNCTION;
|
|
object2.in_app = true;
|
|
object2.lineno = a2;
|
|
Reflect.apply(push, r3, [object2]);
|
|
}
|
|
return a0;
|
|
}
|
|
|