decord/source/6331_getAsyncContextStack.js

168 lines
4.4 KiB
JavaScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 6331
2026-07-27 11:26:19 +00:00
// Function ID: 56894
2026-07-20 16:05:17 +00:00
// Name: getAsyncContextStack
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 6332, 6318, 6329, 6337]
2026-07-20 16:05:17 +00:00
// Exports: getStackAsyncContextStrategy
2026-07-25 08:10:48 +00:00
// Module 6331 (getAsyncContextStack)
2026-07-23 10:11:24 +00:00
import _classCallCheck from "_classCallCheck";
import _defineProperties from "_defineProperties";
2026-07-20 16:05:17 +00:00
function getAsyncContextStack() {
2026-07-25 08:10:48 +00:00
const mainCarrier = require(6329) /* getSentryCarrier */.getMainCarrier();
const obj = require(6329) /* getSentryCarrier */;
const sentryCarrier = require(6329) /* getSentryCarrier */.getSentryCarrier(mainCarrier);
2026-07-20 16:05:17 +00:00
let stack = sentryCarrier.stack;
if (!stack) {
2026-07-25 08:10:48 +00:00
const defaultCurrentScope = require(6337) /* getDefaultCurrentScope */.getDefaultCurrentScope();
const obj3 = require(6337) /* getDefaultCurrentScope */;
2026-07-20 16:05:17 +00:00
const prototype = tmp2.prototype;
2026-07-25 08:10:48 +00:00
stack = new tmp2(defaultCurrentScope, require(6337) /* getDefaultCurrentScope */.getDefaultIsolationScope());
const obj4 = require(6337) /* getDefaultCurrentScope */;
2026-07-20 16:05:17 +00:00
}
sentryCarrier.stack = stack;
return stack;
}
function withScope(arg0) {
return getAsyncContextStack().withScope(arg0);
}
function withSetScope(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const obj = getAsyncContextStack();
return obj.withScope(() => {
2026-07-23 10:11:24 +00:00
obj.getStackTop().scope = closure_0;
return callback(closure_0);
2026-07-20 16:05:17 +00:00
});
}
function withIsolationScope(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
return getAsyncContextStack().withScope(() => callback(outer1_5().getIsolationScope()));
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const tmp2 = (() => {
2026-07-20 16:05:17 +00:00
class AsyncContextStack {
constructor(arg0, arg1) {
scope = arg0;
scope2 = arg1;
self = this;
2026-07-23 10:11:24 +00:00
tmp3 = outer1_2(this, AsyncContextStack);
2026-07-20 16:05:17 +00:00
if (!arg0) {
tmp4 = AsyncContextStack;
2026-07-23 10:11:24 +00:00
tmp5 = outer1_1;
2026-07-20 16:05:17 +00:00
num = 2;
2026-07-23 10:11:24 +00:00
Scope = AsyncContextStack(outer1_1[2]).Scope;
2026-07-20 16:05:17 +00:00
prototype = Scope.prototype;
tmp6 = new.target;
tmp7 = new.target;
scope = new Scope();
}
if (!scope2) {
tmp8 = AsyncContextStack;
2026-07-23 10:11:24 +00:00
tmp9 = outer1_1;
2026-07-20 16:05:17 +00:00
num2 = 2;
2026-07-23 10:11:24 +00:00
Scope2 = AsyncContextStack(outer1_1[2]).Scope;
2026-07-20 16:05:17 +00:00
prototype2 = Scope2.prototype;
tmp10 = new.target;
tmp11 = new.target;
scope2 = new Scope2();
}
obj = {};
obj.scope = scope;
items = [];
items[0] = obj;
self._stack = items;
self._isolationScope = scope2;
return;
}
}
let obj = {
key: "withScope",
value: function withScope(arg0) {
2026-07-23 10:11:24 +00:00
let self = this;
self = this;
2026-07-20 16:05:17 +00:00
const promise = arg0(this._pushScope());
if (obj.isThenable(promise)) {
let nextPromise = promise.then((arg0) => {
self._popScope();
return arg0;
}, (arg0) => {
self._popScope();
throw arg0;
});
} else {
self._popScope();
nextPromise = promise;
}
return nextPromise;
}
};
2026-07-23 10:11:24 +00:00
let items = [obj, , , , , , ];
2026-07-20 16:05:17 +00:00
obj = {
key: "getClient",
value: function getClient() {
return this.getStackTop().client;
}
};
items[1] = obj;
obj = {
key: "getScope",
value: function getScope() {
return this.getStackTop().scope;
}
};
items[2] = obj;
items[3] = {
key: "getIsolationScope",
value: function getIsolationScope() {
return this._isolationScope;
}
};
items[4] = {
key: "getStackTop",
value: function getStackTop() {
return this._stack[this._stack.length - 1];
}
};
items[5] = {
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;
}
};
items[6] = {
key: "_popScope",
value: function _popScope() {
let arr = !tmp;
2026-07-23 10:11:24 +00:00
if (this._stack.length > 1) {
2026-07-20 16:05:17 +00:00
const _stack = this._stack;
arr = _stack.pop();
}
return arr;
}
};
2026-07-23 10:11:24 +00:00
return _defineProperties(AsyncContextStack, items);
})();
let closure_4 = tmp2;
2026-07-20 16:05:17 +00:00
export const AsyncContextStack = tmp2;
export const getStackAsyncContextStrategy = function getStackAsyncContextStrategy() {
return {
withIsolationScope,
withScope,
withSetScope,
withSetIsolationScope(arg0, arg1) {
2026-07-23 10:11:24 +00:00
return outer1_8(arg1);
2026-07-20 16:05:17 +00:00
},
getCurrentScope() {
2026-07-23 10:11:24 +00:00
return outer1_5().getScope();
2026-07-20 16:05:17 +00:00
},
getIsolationScope() {
2026-07-23 10:11:24 +00:00
return outer1_5().getIsolationScope();
2026-07-20 16:05:17 +00:00
}
};
};