fix writer.fill.

This commit is contained in:
Christopher Jeffrey 2016-05-16 17:25:39 -07:00
parent 92c5dd0832
commit 66569df692
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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]);
};