fix writer.fill.
This commit is contained in:
parent
92c5dd0832
commit
66569df692
@ -103,7 +103,7 @@ BufferWriter.prototype.render = function render(keep) {
|
|||||||
off += utils.checksum(data.slice(0, off)).copy(data, off);
|
off += utils.checksum(data.slice(0, off)).copy(data, off);
|
||||||
break;
|
break;
|
||||||
case FILL:
|
case FILL:
|
||||||
item[1].fill(item[1], off, off + item[2]);
|
data.fill(item[1], off, off + item[2]);
|
||||||
off += item[2];
|
off += item[2];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -438,6 +438,10 @@ BufferWriter.prototype.writeChecksum = function writeChecksum() {
|
|||||||
|
|
||||||
BufferWriter.prototype.fill = function fill(value, size) {
|
BufferWriter.prototype.fill = function fill(value, size) {
|
||||||
assert(size >= 0);
|
assert(size >= 0);
|
||||||
|
|
||||||
|
if (size === 0)
|
||||||
|
return;
|
||||||
|
|
||||||
this.written += size;
|
this.written += size;
|
||||||
this.data.push([FILL, value, size]);
|
this.data.push([FILL, value, size]);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user