Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __d(function(e, l, t, u, s) {
- 'use strict';
- var a = l(s[0]),
- i = l(s[1]),
- n = (l(s[2]), l(s[3])),
- h = (l(s[4]), null),
- r = (function() {
- function t() {
- var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
- babelHelpers.classCallCheck(this, t), this._lazyCallableModules = {}, this._queue = [
- [],
- [],
- [], 0
- ], this._successCallbacks = [], this._failureCallbacks = [], this._callID = 0, this._lastFlush = 0, this._eventLoopStartTime = (new Date).getTime(), e ? this.uninstallGlobalErrorHandler() : this.installGlobalErrorHandler(), this.callFunctionReturnFlushedQueue = this.callFunctionReturnFlushedQueue.bind(this), this.callFunctionReturnResultAndFlushedQueue = this.callFunctionReturnResultAndFlushedQueue.bind(this), this.flushedQueue = this.flushedQueue.bind(this), this.invokeCallbackAndReturnFlushedQueue = this.invokeCallbackAndReturnFlushedQueue.bind(this)
- }
- return babelHelpers.createClass(t, [{
- key: "callFunctionReturnFlushedQueue",
- value: function(e, l, t) {
- var u = this;
- return this.__guard(function() {
- u.__callFunction(e, l, t)
- }), this.flushedQueue()
- }
- }, {
- key: "callFunctionReturnResultAndFlushedQueue",
- value: function(e, l, t) {
- var u = this,
- s = void 0;
- return this.__guard(function() {
- s = u.__callFunction(e, l, t)
- }), [s, this.flushedQueue()]
- }
- }, {
- key: "invokeCallbackAndReturnFlushedQueue",
- value: function(e, l) {
- var t = this;
- return this.__guard(function() {
- t.__invokeCallback(e, l)
- }), this.flushedQueue()
- }
- }, {
- key: "flushedQueue",
- value: function() {
- var e = this;
- this.__guard(function() {
- e.__callImmediates()
- });
- var l = this._queue;
- return this._queue = [
- [],
- [],
- [], this._callID
- ], l[0].length ? l : null
- }
- }, {
- key: "getEventLoopRunningTime",
- value: function() {
- return (new Date).getTime() - this._eventLoopStartTime
- }
- }, {
- key: "registerCallableModule",
- value: function(e, l) {
- this._lazyCallableModules[e] = function() {
- return l
- }
- }
- }, {
- key: "registerLazyCallableModule",
- value: function(e, l) {
- var t = void 0,
- u = l;
- this._lazyCallableModules[e] = function() {
- return u && (t = u(), u = null), t
- }
- }
- }, {
- key: "getCallableModule",
- value: function(e) {
- var l = this._lazyCallableModules[e];
- return l ? l() : null
- }
- }, {
- key: "enqueueNativeCall",
- value: function(l, t, u, s, a) {
- (s || a) && (s && u.push(this._callID << 1), a && u.push(this._callID << 1 | 1), this._successCallbacks[this._callID] = a, this._failureCallbacks[this._callID] = s), this._callID++, this._queue[0].push(l), this._queue[1].push(t), this._queue[2].push(u);
- var n = (new Date).getTime();
- if (e.nativeFlushQueueImmediate && (n - this._lastFlush >= 5 || 0 === this._inCall)) {
- var h = this._queue;
- this._queue = [
- [],
- [],
- [], this._callID
- ], this._lastFlush = n, e.nativeFlushQueueImmediate(h)
- }
- i.counterEvent('pending_js_to_native_queue', this._queue[0].length), this.__spy && this.__spy({
- type: 1,
- module: l + '',
- method: t,
- args: u
- })
- }
- }, {
- key: "createDebugLookup",
- value: function(e, l, t) {}
- }, {
- key: "uninstallGlobalErrorHandler",
- value: function() {
- this.__guard = this.__guardUnsafe
- }
- }, {
- key: "installGlobalErrorHandler",
- value: function() {
- this.__guard = this.__guardSafe
- }
- }, {
- key: "__guardUnsafe",
- value: function(e) {
- this._inCall++, e(), this._inCall--
- }
- }, {
- key: "__guardSafe",
- value: function(e) {
- this._inCall++;
- try {
- e()
- } catch (e) {
- alert("4");
- a.reportFatalError(e)
- } finally {
- this._inCall--
- }
- }
- }, {
- key: "__callImmediates",
- value: function() {
- i.beginEvent('JSTimers.callImmediates()'), h || (h = l(s[5])), h.callImmediates(), i.endEvent()
- }
- }, {
- key: "__callFunction",
- value: function(e, l, t) {
- this._lastFlush = (new Date).getTime(), this._eventLoopStartTime = this._lastFlush, i.beginEvent(e + "." + l + "()"), this.__spy && this.__spy({
- type: 0,
- module: e,
- method: l,
- args: t
- });
- var u = this.getCallableModule(e);
- n(!!u, 'Module %s is not a registered callable module (calling %s)', e, l), n(!!u[l], 'Method %s does not exist on module %s', l, e);
- var s = u[l].apply(u, t);
- return i.endEvent(), s
- }
- }, {
- key: "__invokeCallback",
- value: function(e, l) {
- this._lastFlush = (new Date).getTime(), this._eventLoopStartTime = this._lastFlush;
- var t = e >>> 1,
- u = 1 & e ? this._successCallbacks[t] : this._failureCallbacks[t];
- u && (this._successCallbacks[t] = this._failureCallbacks[t] = null, u.apply(void 0, babelHelpers.toConsumableArray(l)))
- }
- }], [{
- key: "spy",
- value: function(e) {
- t.prototype.__spy = !0 === e ? function(e) {
- console.log((0 === e.type ? 'N->JS' : 'JS->N') + " : " + (e.module ? e.module + '.' : '') + e.method + "(" + JSON.stringify(e.args) + ")")
- } : !1 === e ? null : e
- }
- }]), t
- })();
- t.exports = r
- }, 17, [18, 19, 20, 13, 21, 22]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement