summaryrefslogtreecommitdiff
path: root/lib/console.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/console.js')
-rw-r--r--lib/console.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/console.js b/lib/console.js
index 92ac64173a..665a2a6a23 100644
--- a/lib/console.js
+++ b/lib/console.js
@@ -236,6 +236,8 @@ Console.prototype.time = function time(label = 'default') {
};
Console.prototype.timeEnd = function timeEnd(label = 'default') {
+ // Coerces everything other than Symbol to a string
+ label = `${label}`;
const hasWarned = timeLogImpl(this, 'timeEnd', label);
if (!hasWarned) {
this._times.delete(label);
@@ -243,13 +245,13 @@ Console.prototype.timeEnd = function timeEnd(label = 'default') {
};
Console.prototype.timeLog = function timeLog(label, ...data) {
+ // Coerces everything other than Symbol to a string
+ label = `${label}`;
timeLogImpl(this, 'timeLog', label, data);
};
// Returns true if label was not found
function timeLogImpl(self, name, label = 'default', data) {
- // Coerces everything other than Symbol to a string
- label = `${label}`;
const time = self._times.get(label);
if (!time) {
process.emitWarning(`No such label '${label}' for console.${name}()`);