Merge branch 'v0.10'
[platform/upstream/nodejs.git] / lib / buffer.js
index c75dbc9..e5fa44d 100644 (file)
@@ -374,14 +374,15 @@ Buffer.prototype.write = function(string, offset, length, encoding) {
       throw new TypeError('Unknown encoding: ' + encoding);
   }
 
-  Buffer._charsWritten = SlowBuffer._charsWritten;
-
   return ret;
 };
 
 
 Buffer.prototype.toJSON = function() {
-  return Array.prototype.slice.call(this, 0);
+  return {
+    type: 'Buffer',
+    data: Array.prototype.slice.call(this, 0)
+  };
 };