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

fs: remove experimental warning for fs.promises #26581

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3699,7 +3699,7 @@ this API: [`fs.write(fd, string...)`][].

## fs Promises API

> Stability: 1 - Experimental
> Stability: 2 - Stable

The `fs.promises` API provides an alternative set of asynchronous file system
methods that return `Promise` objects rather than using callbacks. The
Expand Down
7 changes: 2 additions & 5 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1930,13 +1930,10 @@ Object.defineProperties(fs, {
},
promises: {
configurable: true,
enumerable: false,
enumerable: true,
get() {
if (promises === null) {
Copy link
Member

@jdalton jdalton Mar 12, 2019

Choose a reason for hiding this comment

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

Please make this property enumerable: true now that it's no longer experimental.
It also no longer needs to be a getter.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jdalton Thanks, done :)

if (promises === null)
promises = require('internal/fs/promises');
process.emitWarning('The fs.promises API is experimental',
'ExperimentalWarning');
}
return promises;
}
}
Expand Down
5 changes: 2 additions & 3 deletions test/parallel/test-fs-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ function nextdir() {
return `test${++dirc}`;
}

// fs.promises should not be enumerable as long as it causes a warning to be
// emitted.
assert.strictEqual(Object.keys(fs).includes('promises'), false);
// fs.promises should not enumerable.
assert.strictEqual(Object.keys(fs).includes('promises'), true);

{
access(__filename, 'r')
Expand Down