Skip to content

Commit

Permalink
stream: use shorthand notation for properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Aug 9, 2019
1 parent f17dca0 commit 5d1898b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/_stream_duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
});

Object.defineProperty(Duplex.prototype, 'writableBuffer', {
get: function() {
get() {
return this._writableState.getBuffer();
}
});
Expand Down
8 changes: 4 additions & 4 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,22 @@ Object.defineProperty(Readable.prototype, 'destroyed', {
});

Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
get: function() {
get() {
return this._readableState.highWaterMark;
}
});

Object.defineProperty(Readable.prototype, 'readableBuffer', {
get: function() {
get() {
return this._readableState.buffer;
}
});

Object.defineProperty(Readable.prototype, 'readableFlowing', {
get: function() {
get() {
return this._readableState.flowing;
},
set: function(state) {
set(state) {
this._readableState.flowing = state;
}
});
Expand Down
4 changes: 2 additions & 2 deletions lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,13 @@ Object.defineProperty(Writable.prototype, 'writableFinished', {
});

Object.defineProperty(Writable.prototype, 'writableBuffer', {
get: function() {
get() {
return this._writableState.getBuffer();
}
});

Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
get: function() {
get() {
return this._writableState.highWaterMark;
}
});
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-stream-duplex-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ const assert = require('assert');

{
function MyDuplex() {
assert.strictEqual(this.destroyed, false);
this.destroyed = false;
Duplex.call(this);
assert.strictEqual(this.destroyed, false);
this.destroyed = true;
assert.strictEqual(this.destroyed, true);
}

Object.setPrototypeOf(MyDuplex.prototype, Duplex.prototype);
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-stream-readable-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ const assert = require('assert');

{
function MyReadable() {
assert.strictEqual(this.destroyed, false);
this.destroyed = false;
Readable.call(this);
assert.strictEqual(this.destroyed, false);
this.destroyed = true;
assert.strictEqual(this.destroyed, true);
}

Object.setPrototypeOf(MyReadable.prototype, Readable.prototype);
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-stream-writable-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ const assert = require('assert');

{
function MyWritable() {
assert.strictEqual(this.destroyed, false);
this.destroyed = false;
Writable.call(this);
assert.strictEqual(this.destroyed, false);
this.destroyed = true;
assert.strictEqual(this.destroyed, true);
}

Object.setPrototypeOf(MyWritable.prototype, Writable.prototype);
Expand Down

0 comments on commit 5d1898b

Please sign in to comment.