A 16-line fix for a WebKit bug that left promises hanging forever

Fixing a WebKit bug to see if promises are made of train tracks

A 16-line fix for a WebKit bug that left promises hanging forever

A small JavaScript program that should crash instead hung in Safari 26 and Bun 1.3.14. Both embed JavaScriptCore, which had a fast path for awaiting real promises: it looked up the species constructor before creating resolve/reject functions. When that lookup threw, there was nothing to reject with, so the promise stayed pending forever. The fix reorders the steps—create the functions first—and is only +16 lines.

Our train had effectively derailed! We didn't even get the chance to finish our journey on either track and so the original program hung because the train never even arrived at the station!

More from this day

2026-11-17