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() {
126126 '_sentryId' ,
127127 // Keeps the frozen DSC on a Sentry Span
128128 '_frozenDsc' ,
129- // These are used to keep span & scope relationships
130- '_sentryRootSpan' ,
131- '_sentryChildSpans' ,
132- '_sentrySpan' ,
133- '_sentryScope' ,
134- '_sentryIsolationScope' ,
135129 // require-in-the-middle calls `Module._resolveFilename`. We cannot mangle this (AWS lambda layer bundle).
136130 '_resolveFilename' ,
137131 // Set on e.g. the shim feedbackIntegration to be able to detect it
Original file line number Diff line number Diff line change 11import type { Scope } from '../scope' ;
22import type { Span } from '../types-hoist' ;
3- import { addNonEnumerableProperty } from '../utils-hoist/object' ;
43
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 > ( ) ;
105
116/**
127 * Set the active span for a given scope.
138 * NOTE: This should NOT be used directly, but is only used internally by the trace methods.
149 */
1510export function _setSpanForScope ( scope : Scope , span : Span | undefined ) : void {
1611 if ( span ) {
17- addNonEnumerableProperty ( scope as ScopeWithMaybeSpan , SCOPE_SPAN_FIELD , span ) ;
12+ SCOPE_TO_SPAN_MAP . set ( scope , span ) ;
1813 } 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 ) ;
2115 }
2216}
2317
2418/**
2519 * Get the active span for a given scope.
2620 * NOTE: This should NOT be used directly, but is only used internally by the trace methods.
2721 */
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 ) ;
3024}
You can’t perform that action at this time.
0 commit comments