Inconsistent interplay between IndexedDB transactions and Promises

后端 未结 3 1975
旧时难觅i
旧时难觅i 2020-12-31 09:54

I saw sync-promise posted on Reddit and got into a discussion with the author. We noticed some weird inconsistencies in the relationship between IndexedDB transactions and p

3条回答
  •  一向
    一向 (楼主)
    2020-12-31 10:41

    This is probably due to the difference between microtasks and tasks ("macrotasks"). Firefox has never had a standards-complaint promise implementation that uses microtasks, whereas Chrome, Bluebird, and others correctly use microtasks. You can see this in how a microtask (which executes "sooner" than a macrotask, but still async) falls inside the transaction boundary, whereas a macrotask (e.g. from Firefox's promises) does not.

    So, this is a Firefox bug.

提交回复
热议问题