buffer: return `this` in fill() for chainability
authorBrian White <mscdex@mscdex.net>
Wed, 29 May 2013 03:36:26 +0000 (23:36 -0400)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 30 May 2013 12:40:09 +0000 (14:40 +0200)
lib/buffer.js

index 48c69f3..8d93384 100644 (file)
@@ -468,9 +468,10 @@ Buffer.prototype.fill = function fill(value, start, end) {
     throw new RangeError('end out of bounds');
   }
 
-  return this.parent.fill(value,
-                          start + this.offset,
-                          end + this.offset);
+  this.parent.fill(value,
+                   start + this.offset,
+                   end + this.offset);
+  return this;
 };