simulateWebError function

  1. @visibleForTesting
void simulateWebError(
  1. Object error,
  2. StackTrace? stack
)

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 windowWebJsError serialization — that needs an E2E smoke, per the Testing strategy.)

Implementation

@visibleForTesting
void simulateWebError(Object error, StackTrace? stack) {
  recordCapturedError(error, stack);
}