Skip to content

Commit

Permalink
fix(runtime): fix for panic in classic workers (#21300)
Browse files Browse the repository at this point in the history
Fixes #21299

(cherry picked from commit 50d1ac9)
  • Loading branch information
mmastrac authored and crowlKats committed Nov 24, 2023
1 parent 47a13f8 commit cad998b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions runtime/web_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit cad998b

Please sign in to comment.