Skip to content

Conversation

@JesseTG
Copy link
Contributor

@JesseTG JesseTG commented Nov 26, 2025

Description

Node.js's documentation says that fs.open returns a Promise<FileHandle>, so it needs to be awaited here.

Motivation

To spare readers the pain of wrong documentation.

Additional details

Node.js's documentation says that `fs.open` returns a `Promise<FileHandle>`, so it needs to be `await`ed here
@JesseTG JesseTG requested a review from a team as a code owner November 26, 2025 20:35
@JesseTG JesseTG requested review from Josh-Cena and removed request for a team November 26, 2025 20:35
@github-actions github-actions bot added Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed labels Nov 26, 2025
@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Nov 26, 2025
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thank you

@Josh-Cena Josh-Cena changed the title Fix async function to await an fs.open call in an example for AsyncDisposableStack.adopt Await fs.open call Nov 26, 2025
@Josh-Cena Josh-Cena merged commit 4196944 into mdn:main Nov 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants