MCPcopy Index your code
hub / github.com/nodejs/node / count

Function count

lib/internal/console/constructor.js:506–519  ·  view source on GitHub ↗
(label = 'default')

Source from the content-addressed store, hash-verified

504
505 // Defined by: https://console.spec.whatwg.org/#count
506 count(label = 'default') {
507 // Ensures that label is a string, and only things that can be
508 // coerced to strings. e.g. Symbol is not allowed
509 label = `${label}`;
510 const counts = this[kCounts];
511 let count = counts.get(label);
512 if (count === undefined)
513 count = 1;
514 else
515 count++;
516 counts.set(label, count);
517 trace(kTraceCount, kTraceConsoleCategory, `count::${label}`, 0, count);
518 this.log(`${label}: ${count}`);
519 },
520
521 // Defined by: https://console.spec.whatwg.org/#countreset
522 countReset(label = 'default') {

Callers

nothing calls this directly

Calls 4

traceFunction · 0.85
getMethod · 0.65
setMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…