File tree Expand file tree Collapse file tree 2 files changed +5
-17
lines changed
dev-packages/rollup-utils/plugins Expand file tree Collapse file tree 2 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -126,12 +126,6 @@ export function makeTerserPlugin() {
126
126
'_sentryId',
127
127
// Keeps the frozen DSC on a Sentry Span
128
128
'_frozenDsc',
129
- // These are used to keep span & scope relationships
130
- '_sentryRootSpan',
131
- '_sentryChildSpans',
132
- '_sentrySpan',
133
- '_sentryScope',
134
- '_sentryIsolationScope',
135
129
// require-in-the-middle calls `Module._resolveFilename`. We cannot mangle this (AWS lambda layer bundle).
136
130
'_resolveFilename',
137
131
// Set on e.g. the shim feedbackIntegration to be able to detect it
Original file line number Diff line number Diff line change 1
1
import type { Scope } from '../scope';
2
2
import type { Span } from '../types-hoist';
3
- import { addNonEnumerableProperty } from '../utils-hoist/object';
4
3
5
- const SCOPE_SPAN_FIELD = '_sentrySpan';
6
-
7
- type ScopeWithMaybeSpan = Scope & {
8
- [SCOPE_SPAN_FIELD]?: Span;
9
- };
4
+ const SCOPE_TO_SPAN_MAP = new WeakMap<Scope, Span>();
10
5
11
6
/**
12
7
* Set the active span for a given scope.
13
8
* NOTE: This should NOT be used directly, but is only used internally by the trace methods.
14
9
*/
15
10
export function _setSpanForScope(scope: Scope, span: Span | undefined): void {
16
11
if (span) {
17
- addNonEnumerableProperty (scope as ScopeWithMaybeSpan, SCOPE_SPAN_FIELD , span);
12
+ SCOPE_TO_SPAN_MAP.set (scope, span);
18
13
} else {
19
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
20
- delete (scope as ScopeWithMaybeSpan)[SCOPE_SPAN_FIELD];
14
+ SCOPE_TO_SPAN_MAP.delete(scope);
21
15
}
22
16
}
23
17
24
18
/**
25
19
* Get the active span for a given scope.
26
20
* NOTE: This should NOT be used directly, but is only used internally by the trace methods.
27
21
*/
28
- export function _getSpanForScope(scope: ScopeWithMaybeSpan ): Span | undefined {
29
- return scope[SCOPE_SPAN_FIELD] ;
22
+ export function _getSpanForScope(scope: Scope ): Span | undefined {
23
+ return SCOPE_TO_SPAN_MAP.get( scope) ;
30
24
}
You can’t perform that action at this time.
0 commit comments