(scope: Scope, span: Span | undefined)
| 14 | * NOTE: This should NOT be used directly, but is only used internally by the trace methods. |
| 15 | */ |
| 16 | export function _setSpanForScope(scope: Scope, span: Span | undefined): void { |
| 17 | if (span) { |
| 18 | // Use WeakRef to avoid circular reference with span holding scope |
| 19 | addNonEnumerableProperty(scope as ScopeWithMaybeSpan, SCOPE_SPAN_FIELD, makeWeakRef(span)); |
| 20 | } else { |
| 21 | // eslint-disable-next-line @typescript-eslint/no-dynamic-delete |
| 22 | delete (scope as ScopeWithMaybeSpan)[SCOPE_SPAN_FIELD]; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Get the active span for a given scope. |
no test coverage detected