// Module ID: 842 // Function ID: 843 // Name: withScope // Dependencies: [41, 42, 843, 827, 825, 847] // Exports: getStackAsyncContextStrategy // Module 842 (withScope) import _classCallCheck from "_classCallCheck"; import _createClass from "_createClass"; let AsyncContextStack = require; function withScope(arg0) { const mainCarrier = AsyncContextStack(825).getMainCarrier(); const obj = AsyncContextStack(825); const sentryCarrier = AsyncContextStack(825).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmpResult = tmp(847); const defaultCurrentScope = tmpResult.getDefaultCurrentScope(); tmpResult = tmp(847); stack = new closure_3(defaultCurrentScope, tmpResult.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return stack.withScope(arg0); } function withSetScope(arg0, arg1) { const AsyncContextStack = arg0; const dependencyMap = arg1; const mainCarrier = AsyncContextStack(825).getMainCarrier(); const obj = AsyncContextStack(825); const sentryCarrier = AsyncContextStack(825).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmpResult = tmp(847); const defaultCurrentScope = tmpResult.getDefaultCurrentScope(); tmpResult = tmp(847); stack = new closure_3(defaultCurrentScope, tmpResult.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return stack.withScope(() => { stack.getStackTop().scope = closure_0; return callback(closure_0); }); } function withIsolationScope(arg0) { const AsyncContextStack = arg0; const mainCarrier = AsyncContextStack(825).getMainCarrier(); const obj = AsyncContextStack(825); const sentryCarrier = AsyncContextStack(825).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmpResult = tmp(847); const defaultCurrentScope = tmpResult.getDefaultCurrentScope(); tmpResult = tmp(847); stack = new closure_3(defaultCurrentScope, tmpResult.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return stack.withScope(() => { const mainCarrier = callback(outer1_1[4]).getMainCarrier(); const obj = callback(outer1_1[4]); const tmp = callback; const sentryCarrier = callback(outer1_1[4]).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmp2Result = tmp2(tmp3[5]); const defaultCurrentScope = tmp2Result.getDefaultCurrentScope(); tmp2Result = tmp2(tmp3[5]); stack = new outer1_3(defaultCurrentScope, tmp2Result.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return tmp(stack.getIsolationScope()); }); } Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); class AsyncContextStack { constructor(arg0, arg1) { self = this; scope = global; tmp2 = withIsolationScope(this, AsyncContextStack); if (!global) { tmp3 = AsyncContextStack; tmp4 = closure_1; tmp5 = new.target; tmp6 = new.target; scope = new require("Scope").Scope(); } scope1 = require; if (!require) { tmp8 = AsyncContextStack; tmp9 = closure_1; tmp10 = new.target; tmp11 = new.target; scope1 = new require("Scope").Scope(); } items = []; items[0] = { scope }; self._stack = items; self._isolationScope = scope1; return; } } let items = [ { key: "withScope", value: function withScope(arg0) { let self = this; self = this; try { const promise = arg0(tmp); if (obj2.isThenable(promise)) { let nextPromise = promise.then((arg0) => { self._popScope(); return arg0; }, (arg0) => { self._popScope(); throw arg0; }); } else { self._popScope(); nextPromise = promise; } return nextPromise; } catch (tmp9) { obj._popScope(); throw tmp9; } } }, { key: "getClient", value: function getClient() { return this.getStackTop().client; } }, { key: "getScope", value: function getScope() { return this.getStackTop().scope; } }, { key: "getIsolationScope", value: function getIsolationScope() { return this._isolationScope; } }, { key: "getStackTop", value: function getStackTop() { return this._stack[this._stack.length - 1]; } }, { key: "_pushScope", value: function _pushScope() { const scope = this.getScope(); const cloneResult = scope.clone(); const _stack = this._stack; _stack.push({ client: this.getClient(), scope: cloneResult }); return cloneResult; } }, { key: "_popScope", value: function _popScope() { let arr = this._stack.length > 1; if (arr) { const _stack = this._stack; arr = _stack.pop(); } return arr; } } ]; const _moduleResult = _createClass(AsyncContextStack, items); let c3 = _moduleResult; export const AsyncContextStack = _moduleResult; export function getStackAsyncContextStrategy() { return { withIsolationScope, withScope, withSetScope, withSetIsolationScope(arg0, arg1) { const callback = arg1; let mainCarrier = callback(825).getMainCarrier(); let obj = callback(825); let sentryCarrier = callback(825).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmpResult = tmp(847); let defaultCurrentScope = tmpResult.getDefaultCurrentScope(); tmpResult = tmp(847); stack = new closure_3(defaultCurrentScope, tmpResult.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return stack.withScope(() => { const mainCarrier = callback(outer1_1[4]).getMainCarrier(); const obj = callback(outer1_1[4]); const tmp = callback; const sentryCarrier = callback(outer1_1[4]).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmp2Result = tmp2(tmp3[5]); const defaultCurrentScope = tmp2Result.getDefaultCurrentScope(); tmp2Result = tmp2(tmp3[5]); stack = new outer1_3(defaultCurrentScope, tmp2Result.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return tmp(stack.getIsolationScope()); }); }, getCurrentScope() { const mainCarrier = callback(825).getMainCarrier(); const obj = callback(825); const sentryCarrier = callback(825).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmpResult = tmp(847); const defaultCurrentScope = tmpResult.getDefaultCurrentScope(); tmpResult = tmp(847); stack = new closure_3(defaultCurrentScope, tmpResult.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return stack.getScope(); }, getIsolationScope() { const mainCarrier = callback(825).getMainCarrier(); const obj = callback(825); const sentryCarrier = callback(825).getSentryCarrier(mainCarrier); let stack = sentryCarrier.stack; if (!stack) { let tmpResult = tmp(847); const defaultCurrentScope = tmpResult.getDefaultCurrentScope(); tmpResult = tmp(847); stack = new closure_3(defaultCurrentScope, tmpResult.getDefaultIsolationScope()); } sentryCarrier.stack = stack; return stack.getIsolationScope(); } }; }