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

do not use process.nextTick without check that it exists #1136

Merged
merged 1 commit into from
Aug 3, 2020

Conversation

nosovk
Copy link
Contributor

@nosovk nosovk commented Jul 30, 2020

if we do not add shims to browser process.nextTick does not exist, because of missing process.
In v8 eventloop sequence is:

process.nextTick(callback) // runs first, after current Tick
setTimeout(callback, 0) // runs after nextTick
setImmediate(callback) // runs after all (https://github.com/nodejs/node-v0.x-archive/issues/25788#issuecomment-128869483)

That's why where is possible (in destructors) process.nextTick substituted with setTimeout.
Where it's significant - substitution will be done if process.nextTick is missing.

@artesan-1
Copy link

Are you sure that any dependant packages don't have the same behavioure?

@YoDaMa YoDaMa merged commit 963e554 into mqttjs:master Aug 3, 2020
PremiumBurger pushed a commit to quickstar/MQTT.js that referenced this pull request Nov 27, 2020
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