95 lines
4.5 KiB
TypeScript
95 lines
4.5 KiB
TypeScript
/* Metro module 8085; source: modules/rpc/transports/PostMessageProxySocket.tsx; dependencies: [6, 7, 15, 17, 18, 4135, 661, 8076, 8075, 8086, 2] */
|
|
function _fun64809(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:6, offset: 0x01bb5e14, size: 246 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_7 = (require(4135) /* metro dependency 4135: Constants */).TransportTypes;
|
|
const env0_8 = (require(661) /* metro dependency 661: Constants */).RPCCloseCodes;
|
|
let value = importDefault(8086) /* metro dependency 8086: BaseSocket */;
|
|
value = _fun64813(value);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/transports/PostMessageProxySocket.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_64810() { // fn#64810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:197, offset: 0x01bb5f0a, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_64810_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun64813(a0) { // fn#64813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:396, offset: 0x01bb5f68, size: 91 bytes, params: 2, frame: 16
|
|
const closure = WindowProxySocket;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'send', value: function(a0) {
|
|
var property = this.onSendingToRPCClient;
|
|
if (property != null) {
|
|
property.call(this, a0, this.id);
|
|
}
|
|
this.postMessageToRPCClient([importDefault(dependencyMap[8]).FRAME, a0], this.origin);
|
|
}}, {key: 'close', value: function(a0, a1) {
|
|
if (!this.closed) {
|
|
this.postClose(this.origin, {code: a0, message: a1}, this.postMessageToRPCClient);
|
|
}
|
|
this.closed = true;
|
|
}}]);
|
|
}
|
|
|
|
function WindowProxySocket({origin, postMessageToRPCClient, frameId, version, encoding, logger, postClose, onSendingToRPCClient}) { // fn#64814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:408, offset: 0x01bb5fc3, size: 423 bytes, params: 2, frame: 27
|
|
var defaultImport2;
|
|
let value = environment.__proto__;
|
|
env1_2(this, WindowProxySocket);
|
|
const POST_MESSAGE = TransportTypes.POST_MESSAGE;
|
|
const items = [POST_MESSAGE, version, encoding];
|
|
const value3 = env1_5(WindowProxySocket);
|
|
const value6 = env1_4(this, _isNativeReflectConstruct_64810() ? global.Reflect.construct(value3, items,
|
|
env1_5(this).constructor) : value3.apply(this, items));
|
|
if (['etf', 'json'].indexOf(encoding) === -1) {
|
|
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
|
|
value = 'Invalid Encoding: ' + encoding;
|
|
value = new defaultImport2({closeCode: RPCCloseCodes.INVALID_ENCODING}, value);
|
|
throw value;
|
|
}
|
|
if (encoding === 'etf') {
|
|
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({closeCode: RPCCloseCodes.INVALID_ENCODING},
|
|
|
|
'Erlpack cannot be used on this client');
|
|
}
|
|
value6.origin = origin;
|
|
value6.postMessageToRPCClient = postMessageToRPCClient;
|
|
value6.frameId = frameId;
|
|
value6.logger = logger;
|
|
value6.postClose = postClose;
|
|
value6.onSendingToRPCClient = onSendingToRPCClient;
|
|
value6.closed = false;
|
|
return value6;
|
|
}
|
|
|