Skip to content
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

dropped queue-tick in favour of queueMicrotask #99

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

telamon
Copy link
Contributor

@telamon telamon commented Jan 28, 2025

No description provided.

@mafintosh mafintosh merged commit b0ba592 into mafintosh:master Jan 28, 2025
3 checks passed
@mafintosh
Copy link
Owner

Nice, its time

@ThaUnknown
Copy link
Contributor

out of personal curiosity, why was queue tick, aka process.nextTick with fallback used in the first place, instead of just raw queueMicrotask? was this for backwards compabitility, or for supporting older versions?

@telamon
Copy link
Contributor Author

telamon commented Feb 5, 2025

The unqualified answer: i suspect queue-tick predates availability of a uniform queueMicrotask().

I had the unfortune to discover that process.nextTick() corrupts the callstack.
This patch was produced in response.

@ThaUnknown
Copy link
Contributor

predates availability

it likely doesn't, qm was introduced in node11 and chrome70, when I originally PR'ed qm as a replacement to nextTick, they were widely available, the nexttick || qm fallback was added later, I always assumed because of some weird compatibility reason, where nextTick was required, seems like that was wrong?

@telamon
Copy link
Contributor Author

telamon commented Feb 5, 2025

@ThaUnknown by the sound of it I was twice unlucky. :'-)

This issue left me scratching my head for some time until nextTick proved to be the culprit:

https://github.com/telamon/native-addon/blob/83dd327c761596c87e6efb1885402a9e725c65dc/test.js#L52

@mafintosh
Copy link
Owner

The answer is compat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants