whatwg / console

Console Standard
https://console.spec.whatwg.org/
Other
269 stars 67 forks source link

Behavior of console.countReset with no arguments is ambiguous #143

Open mliao95 opened 6 years ago

mliao95 commented 6 years ago

Originally, I thought console.countReset() should reset the 'default' label similar to how console.count() increments the 'default' counter. However, the w3c standard for console.countReset() demonstrates that calling console.countReset() after console.count("a label") will reset the "a label" label.
It still remains ambiguous whether the behavior for console.countReset() with no arguments is to reset the most recent label or reset all labels. Personally, it seems that resetting every label or resetting the default label (although it doesn't pass the w3c test) makes the most sense. Let me know what you all think.

domfarolino commented 6 years ago

Your original thought is correct; countReset() should only reset the label default, or display a warning if a count with that label was never started. The test is wrong, thanks for catching this! Going to leave tis open until I take care of it. But yeah, per specification (see IDL for default label value), the label should default to default, and attempt to reset counts with that label.