Merge pull request #2413 from raycon/master

Change source of the term 'microtask'
This commit is contained in:
Ilya Kantor 2020-12-31 14:40:32 +03:00 committed by GitHub
commit 701392c36a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ Why did the `.then` trigger afterwards? What's going on?
## Microtasks queue ## Microtasks queue
Asynchronous tasks need proper management. For that, the ECMA standard specifies an internal queue `PromiseJobs`, more often referred to as the "microtask queue" (ES8 term). Asynchronous tasks need proper management. For that, the ECMA standard specifies an internal queue `PromiseJobs`, more often referred to as the "microtask queue" (V8 term).
As stated in the [specification](https://tc39.github.io/ecma262/#sec-jobs-and-job-queues): As stated in the [specification](https://tc39.github.io/ecma262/#sec-jobs-and-job-queues):
@ -103,7 +103,7 @@ In the example above, `.catch` added by `setTimeout` also triggers. But it does
## Summary ## Summary
Promise handling is always asynchronous, as all promise actions pass through the internal "promise jobs" queue, also called "microtask queue" (ES8 term). Promise handling is always asynchronous, as all promise actions pass through the internal "promise jobs" queue, also called "microtask queue" (V8 term).
So `.then/catch/finally` handlers are always called after the current code is finished. So `.then/catch/finally` handlers are always called after the current code is finished.