console: console.timeLog() using the default label

PR-URL: https://github.com/nodejs/node/pull/24286
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Marie Terrier authored and Ruben Bridgewater committed 2018-11-14 00:55:54 +01:00
1 parent 7601cdfe8b
commit a2c13fac94
2 files changed
+17 -2

No files matched your search

+2 -2
View File
@@ -253,7 +253,7 @@ Console.prototype.timeEnd = function timeEnd(label = 'default') {
}
};
Console.prototype.timeLog = function timeLog(label, ...data) {
Console.prototype.timeLog = function timeLog(label = 'default', ...data) {
// Coerces everything other than Symbol to a string
label = `${label}`;
timeLogImpl(this, 'timeLog', label, data);
@@ -261,7 +261,7 @@ Console.prototype.timeLog = function timeLog(label, ...data) {
};
// Returns true if label was not found
function timeLogImpl(self, name, label = 'default', data) {
function timeLogImpl(self, name, label, data) {
const time = self._times.get(label);
if (!time) {
process.emitWarning(`No such label '${label}' for console.${name}()`);