stefanpenner / es6-promise

A polyfill for ES6-style Promises
MIT License
7.3k stars 593 forks source link

The output sequence is not consistent with native performance #361

Closed ahnuchen closed 2 years ago

ahnuchen commented 4 years ago
setTimeout(() => {
    console.log(1);
}, 0);

new Promise(resolve => {
    resolve()
}).then(() => {
    console.log(2);
})
stefanpenner commented 2 years ago

I'm not sure what this issue describes. On most platforms the sequence will be 2 -> 1 but on platforms without a modern async, that only expose setTimeout the order will be 1 -> 2.

Unfortunately there isn't much we can do about those old platforms.

I'm going to close this issue, but will gladly reopen if I closed in error. I just ask you to help me understand why closing it was not the right call.