Skip to content

Commit 667be1a

Browse files
committed
squash: groupIndent -> kgroupIndent
1 parent c1d5bcc commit 667be1a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/console.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const util = require('util');
2626
const kCounts = Symbol('counts');
2727

2828
// Track amount of indentation required via `console.group()`.
29-
const groupIndent = Symbol('groupIndent');
29+
const kGroupIndent = Symbol('groupIndent');
3030

3131
function Console(stdout, stderr, ignoreErrors = true) {
3232
if (!(this instanceof Console)) {
@@ -60,15 +60,14 @@ function Console(stdout, stderr, ignoreErrors = true) {
6060
Object.defineProperty(this, '_stderrErrorHandler', prop);
6161

6262
this[kCounts] = new Map();
63+
this[kGroupIndent] = '';
6364

6465
// bind the prototype functions to this Console instance
6566
var keys = Object.keys(Console.prototype);
6667
for (var v = 0; v < keys.length; v++) {
6768
var k = keys[v];
6869
this[k] = this[k].bind(this);
6970
}
70-
71-
this[groupIndent] = '';
7271
}
7372

7473
// Make a function that can serve as the callback passed to `stream.write()`.
@@ -116,7 +115,7 @@ function write(ignoreErrors, stream, string, errorhandler) {
116115
Console.prototype.log = function log(...args) {
117116
write(this._ignoreErrors,
118117
this._stdout,
119-
`${this[groupIndent]}${util.format.apply(null, args)}\n`,
118+
`${this[kGroupIndent]}${util.format.apply(null, args)}\n`,
120119
this._stdoutErrorHandler);
121120
};
122121

@@ -127,7 +126,7 @@ Console.prototype.info = Console.prototype.log;
127126
Console.prototype.warn = function warn(...args) {
128127
write(this._ignoreErrors,
129128
this._stderr,
130-
`${this[groupIndent]}${util.format.apply(null, args)}\n`,
129+
`${this[kGroupIndent]}${util.format.apply(null, args)}\n`,
131130
this._stderrErrorHandler);
132131
};
133132

@@ -139,7 +138,7 @@ Console.prototype.dir = function dir(object, options) {
139138
options = Object.assign({ customInspect: false }, options);
140139
write(this._ignoreErrors,
141140
this._stdout,
142-
`${this[groupIndent]}${util.inspect(object, options)}\n`,
141+
`${this[kGroupIndent]}${util.inspect(object, options)}\n`,
143142
this._stdoutErrorHandler);
144143
};
145144

@@ -223,13 +222,14 @@ Console.prototype.group = function group(...data) {
223222
if (data.length > 0) {
224223
this.log(...data);
225224
}
226-
this[groupIndent] += ' ';
225+
this[kGroupIndent] += ' ';
227226
};
228227

229228
Console.prototype.groupCollapsed = Console.prototype.group;
230229

231230
Console.prototype.groupEnd = function groupEnd() {
232-
this[groupIndent] = this[groupIndent].slice(0, this[groupIndent].length - 2);
231+
this[kGroupIndent] =
232+
this[kGroupIndent].slice(0, this[kGroupIndent].length - 2);
233233
};
234234

235235
module.exports = new Console(process.stdout, process.stderr);

0 commit comments

Comments
 (0)