Permalink
Browse files

Properly handle empty/noop Writer#ldelim, fixes #625

  • Loading branch information...
dcodeIO committed Jan 7, 2017
1 parent f303049 commit 1154ce0867306e810cf62a5b41bdb0b765aa8ff3
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/writer.js
@@ -519,11 +519,12 @@ WriterPrototype.ldelim = function ldelim() {
var head = this.head,
tail = this.tail,
len = this.len;
this.reset()
.uint32(len)
.tail.next = head.next; // skip noop
this.tail = tail;
this.len += len;
this.reset().uint32(len);
if (len) {
this.tail.next = head.next; // skip noop
this.tail = tail;
this.len += len;
}
return this;
};

0 comments on commit 1154ce0

Please sign in to comment.