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);
|
||||
break;
|
||||
case FILL:
|
||||
item[1].fill(item[1], off, off + item[2]);
|
||||
data.fill(item[1], off, off + item[2]);
|
||||
off += item[2];
|
||||
break;
|
||||
default:
|
||||
@ -438,6 +438,10 @@ BufferWriter.prototype.writeChecksum = function writeChecksum() {
|
||||
|
||||
BufferWriter.prototype.fill = function fill(value, size) {
|
||||
assert(size >= 0);
|
||||
|
||||
if (size === 0)
|
||||
return;
|
||||
|
||||
this.written += size;
|
||||
this.data.push([FILL, value, size]);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user