From 3e386a77d5c54eb04a5e96aea83db80a6b6304b2 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 11 Mar 2019 10:19:47 +0000 Subject: [PATCH] fs: remove experimental warning for fs.promises This has been warning for long enough, without any API changes in the last few months. PR-URL: https://github.com/nodejs/node/pull/26581 Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Anto Aravinth Reviewed-By: Yongsheng Zhang Reviewed-By: James M Snell Signed-off-by: Beth Griggs --- doc/api/fs.md | 2 +- lib/fs.js | 7 ++----- test/parallel/test-fs-promises.js | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index e65f6c7d4d2885..ec6d931e140fb5 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3686,7 +3686,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 diff --git a/lib/fs.js b/lib/fs.js index e5abc59b591d22..3a299145ff5f8d 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1894,13 +1894,10 @@ Object.defineProperties(fs, { }, promises: { configurable: true, - enumerable: false, + enumerable: true, get() { - if (promises === null) { + if (promises === null) promises = require('internal/fs/promises'); - process.emitWarning('The fs.promises API is experimental', - 'ExperimentalWarning'); - } return promises; } } diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js index 97b5f8326e6052..cdafc11e21a854 100644 --- a/test/parallel/test-fs-promises.js +++ b/test/parallel/test-fs-promises.js @@ -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')