stefanpenner / es6-promise

A polyfill for ES6-style Promises

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The output sequence is not consistent with native performance

ahnuchen opened this issue · comments

setTimeout(() => {
    console.log(1);
}, 0);

new Promise(resolve => {
    resolve()
}).then(() => {
    console.log(2);
})

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.