fs: runtime deprecation for fs.SyncWriteStream
This API was never intended to be made public and was docs-only deprecated in Node.js 6.x. This upgrades to a runtime deprecation for Node.js 8.0.0 PR-URL: https://github.com/nodejs/node/pull/10467 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
4f638f6fd7
commit
7a55e34ef4
@ -509,10 +509,10 @@ The [`util._extend()`][] API has been deprecated.
|
|||||||
<a id="DEP0061"></a>
|
<a id="DEP0061"></a>
|
||||||
### DEP0061: fs.SyncWriteStream
|
### DEP0061: fs.SyncWriteStream
|
||||||
|
|
||||||
Type: Documentation-only
|
Type: Runtime
|
||||||
|
|
||||||
The `fs.SyncWriteStream` class was never intended to be a publicly accessible
|
The `fs.SyncWriteStream` class was never intended to be a publicly accessible
|
||||||
API.
|
API. No alternative API is available. Please use a userland alternative.
|
||||||
|
|
||||||
<a id="DEP0062"></a>
|
<a id="DEP0062"></a>
|
||||||
### DEP0062: node --debug
|
### DEP0062: node --debug
|
||||||
|
16
lib/fs.js
16
lib/fs.js
@ -17,9 +17,9 @@ const FSReqWrap = binding.FSReqWrap;
|
|||||||
const FSEvent = process.binding('fs_event_wrap').FSEvent;
|
const FSEvent = process.binding('fs_event_wrap').FSEvent;
|
||||||
const internalFS = require('internal/fs');
|
const internalFS = require('internal/fs');
|
||||||
const internalURL = require('internal/url');
|
const internalURL = require('internal/url');
|
||||||
|
const internalUtil = require('internal/util');
|
||||||
const assertEncoding = internalFS.assertEncoding;
|
const assertEncoding = internalFS.assertEncoding;
|
||||||
const stringToFlags = internalFS.stringToFlags;
|
const stringToFlags = internalFS.stringToFlags;
|
||||||
const SyncWriteStream = internalFS.SyncWriteStream;
|
|
||||||
const getPathFromURL = internalURL.getPathFromURL;
|
const getPathFromURL = internalURL.getPathFromURL;
|
||||||
|
|
||||||
Object.defineProperty(exports, 'constants', {
|
Object.defineProperty(exports, 'constants', {
|
||||||
@ -2024,12 +2024,14 @@ WriteStream.prototype.close = ReadStream.prototype.close;
|
|||||||
WriteStream.prototype.destroySoon = WriteStream.prototype.end;
|
WriteStream.prototype.destroySoon = WriteStream.prototype.end;
|
||||||
|
|
||||||
// SyncWriteStream is internal. DO NOT USE.
|
// SyncWriteStream is internal. DO NOT USE.
|
||||||
// todo(jasnell): "Docs-only" deprecation for now. This was never documented
|
// This undocumented API was never intended to be made public.
|
||||||
// so there's no documentation to modify. In the future, add a runtime
|
var SyncWriteStream = internalFS.SyncWriteStream;
|
||||||
// deprecation.
|
|
||||||
// Deprecation ID: DEP0061
|
|
||||||
Object.defineProperty(fs, 'SyncWriteStream', {
|
Object.defineProperty(fs, 'SyncWriteStream', {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
writable: true,
|
get: internalUtil.deprecate(() => {
|
||||||
value: SyncWriteStream
|
return SyncWriteStream;
|
||||||
|
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061'),
|
||||||
|
set: internalUtil.deprecate((val) => {
|
||||||
|
SyncWriteStream = val;
|
||||||
|
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061')
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user