Skip to content

Commit

Permalink
console: order functions and remove \n\n
Browse files Browse the repository at this point in the history
This lists all function aliases directly below the declared function.

PR-URL: #17707
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
BridgeAR authored and MylesBorins committed Jan 9, 2018
1 parent 27227cf commit 28283ef
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ function write(ignoreErrors, stream, string, errorhandler, groupIndent) {
}
}


Console.prototype.log = function log(...args) {
write(this._ignoreErrors,
this._stdout,
Expand All @@ -142,13 +141,9 @@ Console.prototype.log = function log(...args) {
this._stdoutErrorHandler,
this[kGroupIndent]);
};


Console.prototype.debug = Console.prototype.log;


Console.prototype.info = Console.prototype.log;

Console.prototype.dirxml = Console.prototype.log;

Console.prototype.warn = function warn(...args) {
write(this._ignoreErrors,
Expand All @@ -157,11 +152,8 @@ Console.prototype.warn = function warn(...args) {
this._stderrErrorHandler,
this[kGroupIndent]);
};


Console.prototype.error = Console.prototype.warn;


Console.prototype.dir = function dir(object, options) {
options = Object.assign({ customInspect: false }, options);
write(this._ignoreErrors,
Expand All @@ -171,17 +163,12 @@ Console.prototype.dir = function dir(object, options) {
this[kGroupIndent]);
};


Console.prototype.dirxml = Console.prototype.log;


Console.prototype.time = function time(label = 'default') {
// Coerces everything other than Symbol to a string
label = `${label}`;
this._times.set(label, process.hrtime());
};


Console.prototype.timeEnd = function timeEnd(label = 'default') {
// Coerces everything other than Symbol to a string
label = `${label}`;
Expand All @@ -196,7 +183,6 @@ Console.prototype.timeEnd = function timeEnd(label = 'default') {
this._times.delete(label);
};


Console.prototype.trace = function trace(...args) {
const err = {
name: 'Trace',
Expand All @@ -206,7 +192,6 @@ Console.prototype.trace = function trace(...args) {
this.error(err.stack);
};


Console.prototype.assert = function assert(expression, ...args) {
if (!expression) {
require('assert').ok(false, util.format.apply(null, args));
Expand Down Expand Up @@ -256,7 +241,6 @@ Console.prototype.group = function group(...data) {
}
this[kGroupIndent] += ' ';
};

Console.prototype.groupCollapsed = Console.prototype.group;

Console.prototype.groupEnd = function groupEnd() {
Expand Down

0 comments on commit 28283ef

Please sign in to comment.