-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Early queueMicroTask() execution #855
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The core-js polyfill implementation of queueMicroTask() always falls back on process.nextTick() in Node, which schedules execution ahead of promise resolve/reject microtasks. This is not the behavior that you get with Node's native queueMicroTask() function.
Consider the following:
Using the core-js polyfill you get "second/first", but using the Node 11+ native function you get "first/second".
This could be resolved using
Promise.resolve().then(...)
instead ofprocess.nextTick(...)
. I realize there would be a performance penalty, but the alternative is running code in an unpredictable order, which can outright break things.The text was updated successfully, but these errors were encountered: