| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent df16f0f commit a273674
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2810,12 +2810,15 @@ an officially supported API. | |||
| 2810 | 2810 | ||
| 2811 | 2811 | <!-- YAML | |
| 2812 | 2812 | changes: | |
| 2813 | + - version: REPLACEME | ||
| 2814 | + pr-url: https://github.com/nodejs/node/pull/58529 | ||
| 2815 | + description: End-of-Life. | ||
| 2813 | 2816 | - version: v13.0.0 | |
| 2814 | 2817 | pr-url: https://github.com/nodejs/node/pull/29061 | |
| 2815 | 2818 | description: Runtime deprecation. | |
| 2816 | 2819 | --> | |
| 2817 | 2820 | ||
| 2818 | - Type: Runtime | ||
| 2821 | + Type: End-of-Life | ||
| 2819 | 2822 | ||
| 2820 | 2823 | [`WriteStream.open()`][] and [`ReadStream.open()`][] are undocumented internal | |
| 2821 | 2824 | APIs that do not make sense to use in userland. File streams should always be | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,6 @@ const { | |||
| 19 | 19 | ERR_SYSTEM_ERROR, | |
| 20 | 20 | } = require('internal/errors').codes; | |
| 21 | 21 | const { | |
| 22 | - deprecate, | ||
| 23 | 22 | kEmptyObject, | |
| 24 | 23 | } = require('internal/util'); | |
| 25 | 24 | const { | |
@@ -52,7 +51,7 @@ function _construct(callback) { | |||
| 52 | 51 | return; | |
| 53 | 52 | } | |
| 54 | 53 | ||
| 55 | - if (stream.open !== openWriteFs && stream.open !== openReadFs) { | ||
| 54 | + if (typeof stream.open === 'function') { | ||
| 56 | 55 | // Backwards compat for monkey patching open(). | |
| 57 | 56 | const orgEmit = stream.emit; | |
| 58 | 57 | stream.emit = function(...args) { | |
@@ -238,11 +237,6 @@ ObjectDefineProperty(ReadStream.prototype, 'autoClose', { | |||
| 238 | 237 | }, | |
| 239 | 238 | }); | |
| 240 | 239 | ||
| 241 | - const openReadFs = deprecate(function() { | ||
| 242 | - // Noop. | ||
| 243 | - }, 'ReadStream.prototype.open() is deprecated', 'DEP0135'); | ||
| 244 | - ReadStream.prototype.open = openReadFs; | ||
| 245 | - | ||
| 246 | 240 | ReadStream.prototype._construct = _construct; | |
| 247 | 241 | ||
| 248 | 242 | ReadStream.prototype._read = function(n) { | |
@@ -407,11 +401,6 @@ ObjectDefineProperty(WriteStream.prototype, 'autoClose', { | |||
| 407 | 401 | }, | |
| 408 | 402 | }); | |
| 409 | 403 | ||
| 410 | - const openWriteFs = deprecate(function() { | ||
| 411 | - // Noop. | ||
| 412 | - }, 'WriteStream.prototype.open() is deprecated', 'DEP0135'); | ||
| 413 | - WriteStream.prototype.open = openWriteFs; | ||
| 414 | - | ||
| 415 | 404 | WriteStream.prototype._construct = _construct; | |
| 416 | 405 | ||
| 417 | 406 | function writeAll(data, size, pos, cb, retries = 0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,16 +2,5 @@ | |||
| 2 | 2 | const common = require('../common'); | |
| 3 | 3 | const fs = require('fs'); | |
| 4 | 4 | ||
| 5 | - common.expectWarning( | ||
| 6 | - 'DeprecationWarning', | ||
| 7 | - 'ReadStream.prototype.open() is deprecated', 'DEP0135'); | ||
| 8 | - const s = fs.createReadStream('asd') | ||
| 9 | - // We don't care about errors in this test. | ||
| 10 | - .on('error', () => {}); | ||
| 11 | - s.open(); | ||
| 12 | - | ||
| 13 | - process.nextTick(() => { | ||
| 14 | - // Allow overriding open(). | ||
| 15 | - fs.ReadStream.prototype.open = common.mustCall(); | ||
| 16 | - fs.createReadStream('asd'); | ||
| 17 | - }); | ||
| 5 | + fs.ReadStream.prototype.open = common.mustCall(); | ||
| 6 | + fs.createReadStream('asd'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,15 +22,6 @@ if (process.argv[2] !== 'child') { | |||
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | 24 | // Child | |
| 25 | - | ||
| 26 | - common.expectWarning( | ||
| 27 | - 'DeprecationWarning', | ||
| 28 | - 'WriteStream.prototype.open() is deprecated', 'DEP0135'); | ||
| 29 | - const s = fs.createWriteStream(`${tmpdir.path}/out`); | ||
| 30 | - s.open(); | ||
| 31 | - | ||
| 32 | - process.nextTick(() => { | ||
| 33 | - // Allow overriding open(). | ||
| 34 | - fs.WriteStream.prototype.open = common.mustCall(); | ||
| 35 | - fs.createWriteStream('asd'); | ||
| 36 | - }); | ||
| 25 | + // Allow overriding open(). | ||
| 26 | + fs.WriteStream.prototype.open = common.mustCall(); | ||
| 27 | + fs.createWriteStream('asd'); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments