Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
28 lines
786 B
Plaintext
28 lines
786 B
Plaintext
import { addNonEnumerableProperty } from './object.js';
|
|
|
|
const SCOPE_SPAN_FIELD = '_sentrySpan';
|
|
|
|
/**
|
|
* Set the active span for a given scope.
|
|
* NOTE: This should NOT be used directly, but is only used internally by the trace methods.
|
|
*/
|
|
function _setSpanForScope(scope, span) {
|
|
if (span) {
|
|
addNonEnumerableProperty(scope , SCOPE_SPAN_FIELD, span);
|
|
} else {
|
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
delete (scope )[SCOPE_SPAN_FIELD];
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get the active span for a given scope.
|
|
* NOTE: This should NOT be used directly, but is only used internally by the trace methods.
|
|
*/
|
|
function _getSpanForScope(scope) {
|
|
return scope[SCOPE_SPAN_FIELD];
|
|
}
|
|
|
|
export { _getSpanForScope, _setSpanForScope };
|
|
//# sourceMappingURL=spanOnScope.js.map
|