diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-11-22 10:02:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-22 10:02:13 -0700 |
commit | 50d1ac9f6b78c6f85b2e0f2894390c24b9c20b46 (patch) | |
tree | edd8c15252358276a2907d229d26c8c5c0cabda5 /runtime/web_worker.rs | |
parent | 616354e76cba0be8af20a0ffefeacfcf6101bafc (diff) |
fix(runtime): fix for panic in classic workers (#21300)
Fixes #21299
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r-- | runtime/web_worker.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index cd5458109..29b6aa370 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -756,9 +756,16 @@ impl WebWorker { return Poll::Ready(Err(e)); } - panic!( - "coding error: either js is polling or the worker is terminated" - ); + // TODO(mmastrac): we don't want to test this w/classic workers because + // WPT triggers a failure here. This is only exposed via --enable-testing-features-do-not-use. + if self.worker_type == WebWorkerType::Module { + panic!( + "coding error: either js is polling or the worker is terminated" + ); + } else { + eprintln!("classic worker terminated unexpectedly"); + Poll::Ready(Ok(())) + } } Poll::Pending => Poll::Pending, } |