From 5b4d5321ee6939044b52aa72de947911b0a8ec00 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 16 Dec 2017 01:36:23 -0200 Subject: [PATCH] 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 Reviewed-By: James M Snell --- lib/console.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/console.js b/lib/console.js index ae268d8f8417b0..cbaef074046f9c 100644 --- a/lib/console.js +++ b/lib/console.js @@ -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() {