Merge pull request #12365 from Snuffleupagus/forbid-DecodeStream.length

Ensure that the `length` property won't be *accidentally* accessed on a `DecodeStream`-instance
This commit is contained in:
Tim van der Meij 2020-09-11 22:18:30 +02:00 committed by GitHub
commit dfebe7b907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,6 +167,11 @@ var DecodeStream = (function DecodeStreamClosure() {
} }
DecodeStream.prototype = { DecodeStream.prototype = {
// eslint-disable-next-line getter-return
get length() {
unreachable("Should not access DecodeStream.length");
},
get isEmpty() { get isEmpty() {
while (!this.eof && this.bufferLength === 0) { while (!this.eof && this.bufferLength === 0) {
this.readBlock(); this.readBlock();