Merge pull request #3424 from yurydelendik/lookChar

lookChar refactoring
This commit is contained in:
Brendan Dahl 2013-07-11 09:08:59 -07:00
commit 5dcc4cd1b4
8 changed files with 251 additions and 272 deletions

View file

@ -118,7 +118,7 @@ var ChunkedStream = (function ChunkedStreamClosure() {
getByte: function ChunkedStream_getByte() {
var pos = this.pos;
if (pos >= this.end) {
return null;
return -1;
}
this.ensureRange(pos, pos + 1);
return this.bytes[this.pos++];
@ -156,22 +156,6 @@ var ChunkedStream = (function ChunkedStreamClosure() {
return this.bytes.subarray(begin, end);
},
lookChar: function ChunkedStream_lookChar() {
var pos = this.pos;
if (pos >= this.end)
return null;
this.ensureRange(pos, pos + 1);
return String.fromCharCode(this.bytes[pos]);
},
getChar: function ChunkedStream_getChar() {
var pos = this.pos;
if (pos >= this.end)
return null;
this.ensureRange(pos, pos + 1);
return String.fromCharCode(this.bytes[this.pos++]);
},
skip: function ChunkedStream_skip(n) {
if (!n)
n = 1;