mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
Before this the event loop was spun until the state of the promise was not pending, however it is possible that a promise has already been fulfilled/rejected when awaiting it. This could then lead to a crash below as it would not pump the event loop in such cases. Although this change is in LibJS, it really only impacts any usage of LibJS within a EventLoop environment such as LibWeb. Instead of checking the state of the promise we know check that success has a value which can only happen if either the fulfilled or rejected closure set up by await are called.
5.7 KiB
5.7 KiB