recordEscape method
error is leaving the innermost call. The first call it leaves is the
one that knows where it was raised, so only that one records.
A value an Expando cannot hold — a string, a number, a boolean, null —
gets no trace: the interpreter wraps a script's own throw in an object,
so this is only ever a host value thrown natively.
Implementation
void recordEscape(Object? error) {
if (error == null || error is String || error is num || error is bool) {
return;
}
if (_traces[error] != null) return;
_traces[error] = _snapshot();
}