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

Add a note on the post "Faster async functions and promises". #737

Merged
merged 6 commits into from
Feb 28, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/blog/fast-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ We’ve also been working on a new garbage collector, called Orinoco, which move

And last but not least, there was a handy bug in Node.js 8 that caused `await` to skip microticks in some cases, resulting in better performance. The bug started out as an unintended spec violation, but it later gave us the idea for an optimization. Let’s start by explaining the buggy behavior:

:::note
**Note:** The following '`await` bug' behavior considered a bug according to earlier JavaScript specifications, is deemed 'correct behavior' according to the latest JavaScript specification. We updated Node.js to follow earlier specs in Node.js 10, while also realizing that the previous 'bug' is more obvious and efficient behavior. So we proposed a change to JavaScript spec to make previous 'bug' to be 'correct behavior'. After this change was accepted, we went back to previous behavior on Node.js 12.
LeszekSwirski marked this conversation as resolved.
Show resolved Hide resolved
:::

```js
const p = Promise.resolve();

Expand Down