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

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

> Hacker News story 50499520 · language: en · submitted 2026-11-14
> Web version: https://zeli.app/story/50499520
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 35 · by [dverlaeckt80](<https://news.ycombinator.com/user?id=dverlaeckt80>) · 💬 1
[original](<https://alistair.sh/thenables>) · [HN discussion](<https://news.ycombinator.com/item?id=50499520>)

## Summary

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.

## Key quote

> 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!

---

## Cite

- Page: https://zeli.app/story/50499520
- Date: 2026-11-14
- Source: alistair.sh (https://alistair.sh/thenables)
- Hacker News: https://news.ycombinator.com/item?id=50499520

## Other languages

- zh: https://zeli.app/zh/story/50499520 · markdown: https://zeli.app/zh/story/50499520.md
- ja: https://zeli.app/ja/story/50499520 · markdown: https://zeli.app/ja/story/50499520.md
- ko: https://zeli.app/ko/story/50499520 · markdown: https://zeli.app/ko/story/50499520.md
- de: https://zeli.app/de/story/50499520 · markdown: https://zeli.app/de/story/50499520.md
- es: https://zeli.app/es/story/50499520 · markdown: https://zeli.app/es/story/50499520.md
- ru: https://zeli.app/ru/story/50499520 · markdown: https://zeli.app/ru/story/50499520.md
