100 lines
5.4 KiB
TypeScript
100 lines
5.4 KiB
TypeScript
/* Metro module 8085; source: modules/rpc/transports/PostMessageProxySocket.tsx; dependencies: [6, 7, 15, 17, 18, 4135, 661, 8076, 8075, 8086, 2] */
|
|
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import BaseSocket from './BaseSocket.tsx'; /* Metro dependency 8086 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as ConstantsModule2 from '../Constants.tsx'; /* Metro dependency 4135 */
|
|
|
|
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});
|
|
let value = BaseSocket;
|
|
value = _fun64813(value);
|
|
(FileImportTrackerModule).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 WindowProxySocket2 = WindowProxySocket;
|
|
Inherits(WindowProxySocket2, a0);
|
|
return CreateClass(WindowProxySocket2, [{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 items2 = [POST_MESSAGE, version, encoding];
|
|
const value3 = env1_5(WindowProxySocket);
|
|
const value6 = env1_4(this, _isNativeReflectConstruct_64810() ? global.Reflect.construct(value3, items2,
|
|
env1_5(this).constructor) : value3.apply(this, items2));
|
|
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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun64809, 8085, [6, 7, 15, 17, 18, 4135, 661, 8076, 8075, 8086,
|
|
2]) /* metro module 8085, dependencies: [6, 7, 15, 17, 18, 4135, 661, 8076, 8075, 8086, 2] */;
|