Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Commit 86a9f2b

Browse files
committed
chore: rename span#context() to span#spanContext
1 parent 41109c8 commit 86a9f2b

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/context/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function setSpanContext(
7575
* @param context context to get values from
7676
*/
7777
export function getSpanContext(context: Context): SpanContext | undefined {
78-
return getSpan(context)?.context();
78+
return getSpan(context)?.spanContext();
7979
}
8080

8181
/**

src/trace/NoopSpan.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class NoopSpan implements Span {
3333
) {}
3434

3535
// Returns a SpanContext.
36-
context(): SpanContext {
36+
spanContext(): SpanContext {
3737
return this._spanContext;
3838
}
3939

src/trace/span.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface Span {
3939
*
4040
* @returns the SpanContext object associated with this Span.
4141
*/
42-
context(): SpanContext;
42+
spanContext(): SpanContext;
4343

4444
/**
4545
* Sets an attribute to the span.

test/noop-implementations/noop-span.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('NoopSpan', () => {
4444
span.updateName('my-span');
4545

4646
assert.ok(!span.isRecording());
47-
assert.deepStrictEqual(span.context(), {
47+
assert.deepStrictEqual(span.spanContext(), {
4848
traceId: INVALID_TRACEID,
4949
spanId: INVALID_SPANID,
5050
traceFlags: TraceFlags.NONE,

test/noop-implementations/noop-tracer.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ describe('NoopTracer', () => {
5252
{},
5353
setSpanContext(context.active(), parent)
5454
);
55-
assert(span.context().traceId === parent.traceId);
56-
assert(span.context().spanId === parent.spanId);
57-
assert(span.context().traceFlags === parent.traceFlags);
55+
assert(span.spanContext().traceId === parent.traceId);
56+
assert(span.spanContext().spanId === parent.spanId);
57+
assert(span.spanContext().traceFlags === parent.traceFlags);
5858
});
5959
});

0 commit comments

Comments
 (0)