mirror of https://github.com/nodejs/node.git
Make buffer.INSPECT_MAX_BYTES public for mscdex
parent
7332c4022f
commit
2689d262ec
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue