in lib/src/stack_zone_specification.dart [89:108]
Chain chainFor(StackTrace? trace) {
if (trace is Chain) return trace;
trace ??= StackTrace.current;
var previous = _chains[trace] ?? _currentNode;
if (previous == null) {
// If there's no [_currentNode], we're running synchronously beneath
// [Chain.capture] and we should fall back to the VM's stack chaining. We
// can't use [Chain.from] here because it'll just call [chainFor] again.
if (trace is Trace) return Chain([trace]);
return LazyChain(() => Chain.parse(trace!.toString()));
} else {
if (trace is! Trace) {
var original = trace;
trace = LazyTrace(() => Trace.parse(_trimVMChain(original)));
}
return _Node(trace, previous).toChain();
}
}