Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7a55e34

Browse filesBrowse files
committed
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: #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>
1 parent 4f638f6 commit 7a55e34
Copy full SHA for 7a55e34

File tree

Expand file treeCollapse file tree

2 files changed

+11
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-9
lines changed
Open diff view settings
Collapse file

‎doc/api/deprecations.md‎

Copy file name to clipboardExpand all lines: doc/api/deprecations.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,10 @@ The [`util._extend()`][] API has been deprecated.
509509
<a id="DEP0061"></a>
510510
### DEP0061: fs.SyncWriteStream
511511

512-
Type: Documentation-only
512+
Type: Runtime
513513

514514
The `fs.SyncWriteStream` class was never intended to be a publicly accessible
515-
API.
515+
API. No alternative API is available. Please use a userland alternative.
516516

517517
<a id="DEP0062"></a>
518518
### DEP0062: node --debug
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const FSReqWrap = binding.FSReqWrap;
1717
const FSEvent = process.binding('fs_event_wrap').FSEvent;
1818
const internalFS = require('internal/fs');
1919
const internalURL = require('internal/url');
20+
const internalUtil = require('internal/util');
2021
const assertEncoding = internalFS.assertEncoding;
2122
const stringToFlags = internalFS.stringToFlags;
22-
const SyncWriteStream = internalFS.SyncWriteStream;
2323
const getPathFromURL = internalURL.getPathFromURL;
2424

2525
Object.defineProperty(exports, 'constants', {
@@ -2024,12 +2024,14 @@ WriteStream.prototype.close = ReadStream.prototype.close;
20242024
WriteStream.prototype.destroySoon = WriteStream.prototype.end;
20252025

20262026
// SyncWriteStream is internal. DO NOT USE.
2027-
// todo(jasnell): "Docs-only" deprecation for now. This was never documented
2028-
// so there's no documentation to modify. In the future, add a runtime
2029-
// deprecation.
2030-
// Deprecation ID: DEP0061
2027+
// This undocumented API was never intended to be made public.
2028+
var SyncWriteStream = internalFS.SyncWriteStream;
20312029
Object.defineProperty(fs, 'SyncWriteStream', {
20322030
configurable: true,
2033-
writable: true,
2034-
value: SyncWriteStream
2031+
get: internalUtil.deprecate(() => {
2032+
return SyncWriteStream;
2033+
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061'),
2034+
set: internalUtil.deprecate((val) => {
2035+
SyncWriteStream = val;
2036+
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061')
20352037
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.