console: order functions and remove \n\n

This lists all function aliases directly below the declared function.

PR-URL: https://github.com/nodejs/node/pull/17707
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ruben Bridgewater 2017-12-16 01:36:23 -02:00
parent 0eab49523d
commit 5b4d5321ee
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -131,7 +131,6 @@ function write(ignoreErrors, stream, string, errorhandler, groupIndent) {
}
}
Console.prototype.log = function log(...args) {
write(this._ignoreErrors,
this._stdout,
@ -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,
@ -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,
@ -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}`;
@ -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',
@ -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));
@ -256,7 +241,6 @@ Console.prototype.group = function group(...data) {
}
this[kGroupIndent] += ' ';
};
Console.prototype.groupCollapsed = Console.prototype.group;
Console.prototype.groupEnd = function groupEnd() {