Skip to content

Commit

Permalink
Merge pull request #12365 from Snuffleupagus/forbid-DecodeStream.length
Browse files Browse the repository at this point in the history
Ensure that the `length` property won't be *accidentally* accessed on a `DecodeStream`-instance
  • Loading branch information
timvandermeij authored Sep 11, 2020
2 parents 008eed0 + a11b734 commit dfebe7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ var DecodeStream = (function DecodeStreamClosure() {
}

DecodeStream.prototype = {
// eslint-disable-next-line getter-return
get length() {
unreachable("Should not access DecodeStream.length");
},

get isEmpty() {
while (!this.eof && this.bufferLength === 0) {
this.readBlock();
Expand Down

0 comments on commit dfebe7b

Please sign in to comment.