Merge pull request #11301 from Snuffleupagus/peekByte-eof
Ensure that the `peekByte` methods, on the various Streams, handles end of data correctly (PR 5286 follow-up)
This commit is contained in:
commit
0eda75c8fd
@ -213,7 +213,9 @@ class ChunkedStream {
|
||||
|
||||
peekByte() {
|
||||
const peekedByte = this.getByte();
|
||||
this.pos--;
|
||||
if (peekedByte !== -1) {
|
||||
this.pos--;
|
||||
}
|
||||
return peekedByte;
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,9 @@ var Stream = (function StreamClosure() {
|
||||
},
|
||||
peekByte: function Stream_peekByte() {
|
||||
var peekedByte = this.getByte();
|
||||
this.pos--;
|
||||
if (peekedByte !== -1) {
|
||||
this.pos--;
|
||||
}
|
||||
return peekedByte;
|
||||
},
|
||||
peekBytes(length, forceClamped = false) {
|
||||
@ -234,7 +236,9 @@ var DecodeStream = (function DecodeStreamClosure() {
|
||||
},
|
||||
peekByte: function DecodeStream_peekByte() {
|
||||
var peekedByte = this.getByte();
|
||||
this.pos--;
|
||||
if (peekedByte !== -1) {
|
||||
this.pos--;
|
||||
}
|
||||
return peekedByte;
|
||||
},
|
||||
peekBytes(length, forceClamped = false) {
|
||||
|
Loading…
Reference in New Issue
Block a user