Skip to content

Commit 2fe96e4

Browse files
author
David Mark Clements
committed
lint fixes
1 parent 447a895 commit 2fe96e4

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

doc/api/stream.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ on the type of stream being created, as detailed in the chart below:
17321732
| Reading only | [`Readable`][] | [`_read()`][stream-_read] |
17331733
| Writing only | [`Writable`][] | [`_write()`][stream-_write], [`_writev()`][stream-_writev], [`_final()`][stream-_final] |
17341734
| Reading and writing | [`Duplex`][] | [`_read()`][stream-_read], [`_write()`][stream-_write], [`_writev()`][stream-_writev], [`_final()`][stream-_final] |
1735-
| Operate on written data, then read the result | [`Transform`][] | [`_transform()`][stream-_transform], [`_flush()`][stream-_flush], [`_final()`][stream-_final] |
1735+
| Operate on written data, then read the result | [`Transform`][] | [`_transform()`][], [`_flush()`][stream-_flush], [`_final()`][stream-_final] |
17361736

17371737
The implementation code for a stream should *never* call the "public" methods
17381738
of a stream that are intended for use by consumers (as described in the
@@ -2473,7 +2473,7 @@ The `stream.Transform` class is extended to implement a [`Transform`][] stream.
24732473
The `stream.Transform` class prototypically inherits from `stream.Duplex` and
24742474
implements its own versions of the `writable._write()` and `readable._read()`
24752475
methods. Custom `Transform` implementations *must* implement the
2476-
[`transform._transform()`][stream-_transform] method and *may* also implement
2476+
[`transform._transform()`][] method and *may* also implement
24772477
the [`transform._flush()`][stream-_flush] method.
24782478

24792479
Care must be taken when using `Transform` streams in that data written to the
@@ -2485,7 +2485,7 @@ output on the `Readable` side is not consumed.
24852485
* `options` {Object} Passed to both `Writable` and `Readable`
24862486
constructors. Also has the following fields:
24872487
* `transform` {Function} Implementation for the
2488-
[`stream._transform()`][stream-_transform] method.
2488+
[`stream._transform()`][] method.
24892489
* `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush]
24902490
method.
24912491

@@ -2532,7 +2532,7 @@ const myTransform = new Transform({
25322532
The [`'finish'`][] and [`'end'`][] events are from the `stream.Writable`
25332533
and `stream.Readable` classes, respectively. The `'finish'` event is emitted
25342534
after [`stream.end()`][stream-end] is called and all chunks have been processed
2535-
by [`stream._transform()`][stream-_transform]. The `'end'` event is emitted
2535+
by [`stream._transform()`][]. The `'end'` event is emitted
25362536
after all data has been output, which occurs after the callback in
25372537
[`transform._flush()`][stream-_flush] has been called. In the case of an error,
25382538
neither `'finish'` nor `'end'` should be emitted.
@@ -2926,7 +2926,7 @@ contain multi-byte characters.
29262926
[stream-_final]: #stream_writable_final_callback
29272927
[stream-_flush]: #stream_transform_flush_callback
29282928
[stream-_read]: #stream_readable_read_size_1
2929-
[stream-_transform]: #stream_transform_transform_chunk_encoding_callback
2929+
[]: #stream_transform_transform_chunk_encoding_callback
29302930
[stream-_write]: #stream_writable_write_chunk_encoding_callback_1
29312931
[stream-_writev]: #stream_writable_writev_chunks_callback
29322932
[stream-end]: #stream_writable_end_chunk_encoding_callback

lib/_stream_transform.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565

6666
const {
6767
ObjectSetPrototypeOf,
68+
ObjectGetPrototypeOf,
69+
Symbol
6870
} = primordials;
6971

7072
module.exports = Transform;
@@ -76,8 +78,8 @@ const {
7678
ERR_TRANSFORM_WITH_LENGTH_0
7779
} = require('internal/errors').codes;
7880
const Duplex = require('_stream_duplex');
79-
const AsyncIteratorPrototype = Object.getPrototypeOf(
80-
Object.getPrototypeOf(async function* () {}).prototype);
81+
const AsyncIteratorPrototype = ObjectGetPrototypeOf(
82+
ObjectGetPrototypeOf(async function* () {}).prototype);
8183

8284
const kSourceIteratorPull = Symbol('kSourceIteratorPull');
8385
const kSourceIteratorResolve = Symbol('kSourceIteratorResolve');
@@ -86,8 +88,8 @@ const kSourceIteratorStream = Symbol('kSourceIteratorStream');
8688
const kSourceIteratorPump = Symbol('kSourceIteratorPump');
8789
const kSourceIteratorGrabResolve = Symbol('kSourceIteratorGrabResolve');
8890

89-
Object.setPrototypeOf(Transform.prototype, Duplex.prototype);
90-
Object.setPrototypeOf(Transform, Duplex);
91+
ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype);
92+
ObjectSetPrototypeOf(Transform, Duplex);
9193

9294

9395
function afterTransform(er, data) {
@@ -271,8 +273,7 @@ SourceIterator.prototype[Symbol.asyncIterator] = function() {
271273
return this;
272274
};
273275

274-
Object.setPrototypeOf(SourceIterator.prototype,
275-
AsyncIteratorPrototype);
276+
ObjectSetPrototypeOf(SourceIterator.prototype, AsyncIteratorPrototype);
276277

277278
SourceIterator.prototype.next = function next() {
278279
if (this[kSourceIteratorPull] === null || this[kSourceIteratorChunk] === null)

0 commit comments

Comments
 (0)