Skip to content

Commit

Permalink
Merge pull request #205 from YoshinoriN/backport-issue195-for-nodejsv14
Browse files Browse the repository at this point in the history
fix: avoid overriding Transform.destroy() method
  • Loading branch information
yoshinorin committed May 12, 2020
2 parents 595aaab + 2291ec5 commit 77b002b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions lib/cache_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ CacheStream.prototype._transform = function(chunk, enc, callback) {
callback();
};

CacheStream.prototype.destroy = function() {
this._cache.length = 0;
};

CacheStream.prototype.getCache = function() {
return Buffer.concat(this._cache);
};
Expand Down
8 changes: 0 additions & 8 deletions test/cache_stream.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,4 @@ describe('CacheStream', () => {
cacheStream.getCache().should.eql(content);
});
});

it('destroy', () => {
const cacheStream = new CacheStream();
cacheStream._cache = [Buffer.alloc(1)];

cacheStream.destroy();
cacheStream._cache.should.have.length(0);
});
});

0 comments on commit 77b002b

Please sign in to comment.