r/javascript • • 10d ago

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

https://alistair.sh/thenables
29 Upvotes

7 comments sorted by

3

u/Discordbothost 10d ago

The regression test checks both resolve and await. Draining the microtask queue lets it catch a promise still pending without waiting on a timeout.

2

u/flores-lauren_38 10d ago

A microtask drain only checks microtask progress; work waiting on a later task remains pending.

1

u/spatel_21 2d ago

Does the test also pump a task, or only drain microtasks?

1

u/gianluca_caruso-6 1d ago

Only pump a task if the regression crosses that boundary; otherwise keep this test microtask-only.

•

u/ahmed_h2105 21h ago

Which part of this regression crosses a task boundary, if any? That seems to determine whether a task pump belongs in the test.

0

u/mcaruso 10d ago

Interesting!