From bd7d7a7e1789ca336716f8ab6fb8f2ec4c555e9e Mon Sep 17 00:00:00 2001 From: Tyler Brazier Date: Tue, 11 Oct 2016 22:34:36 -0500 Subject: [PATCH] console: name anonymous functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref: https://github.com/nodejs/node/issues/8913 PR-URL: https://github.com/nodejs/node/pull/9047 Reviewed-By: Ilkka Myller Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- lib/console.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/console.js b/lib/console.js index 2359cb36e011d0..ba92c91636ba38 100644 --- a/lib/console.js +++ b/lib/console.js @@ -39,7 +39,7 @@ function Console(stdout, stderr) { // As of v8 5.0.71.32, the combination of rest param, template string // and .apply(null, args) benchmarks consistently faster than using // the spread operator when calling util.format. -Console.prototype.log = function(...args) { +Console.prototype.log = function log(...args) { this._stdout.write(`${util.format.apply(null, args)}\n`); }; @@ -47,7 +47,7 @@ Console.prototype.log = function(...args) { Console.prototype.info = Console.prototype.log; -Console.prototype.warn = function(...args) { +Console.prototype.warn = function warn(...args) { this._stderr.write(`${util.format.apply(null, args)}\n`); }; @@ -55,18 +55,18 @@ Console.prototype.warn = function(...args) { Console.prototype.error = Console.prototype.warn; -Console.prototype.dir = function(object, options) { +Console.prototype.dir = function dir(object, options) { options = Object.assign({customInspect: false}, options); this._stdout.write(`${util.inspect(object, options)}\n`); }; -Console.prototype.time = function(label) { +Console.prototype.time = function time(label) { this._times.set(label, process.hrtime()); }; -Console.prototype.timeEnd = function(label) { +Console.prototype.timeEnd = function timeEnd(label) { const time = this._times.get(label); if (!time) { process.emitWarning(`No such label '${label}' for console.timeEnd()`); @@ -90,7 +90,7 @@ Console.prototype.trace = function trace(...args) { }; -Console.prototype.assert = function(expression, ...args) { +Console.prototype.assert = function assert(expression, ...args) { if (!expression) { require('assert').ok(false, util.format.apply(null, args)); }