-
- Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
This doesn't seem right to me, but feel free to close if it is. Promises somehow always get in between nextTick and setImmediate. This was causing a weird timing bug for me when I switched some code from Bluebird to native promises:
~function(){ setTimeout (console.log.bind(console, 'timeout A')); process.nextTick (console.log.bind(console, 'nextTick A')); setImmediate (console.log.bind(console, 'setImmediate A')); Promise.resolve().then(console.log.bind(console, 'promise')); process.nextTick (console.log.bind(console, 'nextTick B')); setImmediate (console.log.bind(console, 'setImmediate B')); setTimeout (console.log.bind(console, 'timeout B')); }();Native yields:
nextTick A nextTick B promise undefined setImmediate A setImmediate B timeout A timeout B Bluebird yields:
nextTick A nextTick B setImmediate A promise undefined setImmediate B timeout A timeout B Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.