| 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') { |