Skip to content

Commit

Permalink
Make buffer.INSPECT_MAX_BYTES public for mscdex
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 9, 2011
1 parent 7332c40 commit 2689d26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc/api/buffers.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,7 @@ given it will fill the entire buffer.
var b = new Buffer(50);
b.fill("h");

### INSPECT_MAX_BYTES

How many bytes will be returned when `b.inspect()` is called. This can
be overriden by user modules.
6 changes: 3 additions & 3 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
var SlowBuffer = process.binding('buffer').SlowBuffer;
var assert = require('assert');

var INSPECT_MAX_BYTES = 50;
exports.INSPECT_MAX_BYTES = 50;


function toHex(n) {
Expand All @@ -36,7 +36,7 @@ SlowBuffer.prototype.inspect = function() {
len = this.length;
for (var i = 0; i < len; i++) {
out[i] = toHex(this[i]);
if (i == INSPECT_MAX_BYTES) {
if (i == exports.INSPECT_MAX_BYTES) {
out[i + 1] = '...';
break;
}
Expand Down Expand Up @@ -287,7 +287,7 @@ Buffer.prototype.inspect = function inspect() {

for (var i = 0; i < len; i++) {
out[i] = toHex(this.parent[i + this.offset]);
if (i == INSPECT_MAX_BYTES) {
if (i == exports.INSPECT_MAX_BYTES) {
out[i + 1] = '...';
break;
}
Expand Down

0 comments on commit 2689d26

Please sign in to comment.