The interface allows passing both Span and SpanContext as an argument
for creating References.
But the instanceof check won't always work in runtime, for example, for cases
when Span implementation does not extend the opentracing.Span class, but just
implements the interface.
The popular jaeger-client-node library does exactly that.
This produces hard-to-track errors.
I added additional checks to distinguish between Span and SpanContext instances.
The interface allows passing both Span and SpanContext as an argument for creating References. But the
instanceof
check won't always work in runtime, for example, for cases when Span implementation does not extend the opentracing.Span class, but just implements the interface. The popularjaeger-client-node
library does exactly that.This produces hard-to-track errors.
I added additional checks to distinguish between Span and SpanContext instances.
Resolves: #161