3 ms·
- if the language eagerly binds on determined promises (ie it doesn’t schedule your .then function) you can get weird semantic bugs. What would be an example o
by feoren 4y ago
- if the language eagerly binds on determined promises (ie it doesn’t schedule your .then function) you can get weird semantic bugs.
What would be an example of this? If the promise has been determined, why not just immediately run the .then function?
- afiori 4y agoThe reason not to do it is to limit the non-determinism of the order of execution. In Javascript f1(); p.then(f3); f2(); functions are always called in the relative order f1, f2, f3 and never f1, f3 , f2 even if p had already resolved.