1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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 = {
// eslint-disable-next-line getter-return
get length() {
unreachable("Should not access DecodeStream.length");
},
get isEmpty() {
while (!this.eof && this.bufferLength === 0) {
this.readBlock();