simulateWebError function
Test-only seam (ERH-009): synthesizes the chokepoint routing a real web-JS
handler performs, BYPASSING window, so VM unit tests can cover the routing
without a browser. (Note: because it bypasses window, it cannot catch a
defect in the real window→WebJsError serialization — that needs an E2E
smoke, per the Testing strategy.)
Implementation
@visibleForTesting
void simulateWebError(Object error, StackTrace? stack) {
recordCapturedError(error, stack);
}