whatwg / console

Console Standard
https://console.spec.whatwg.org/
Other
272 stars 69 forks source link

Make the spec for time()/timeEnd() a bit more accurate and rigorous #105

Closed domenic closed 7 years ago

domenic commented 7 years ago

Notable changes include the addition of a colon to the output, being explicit about how the implementation decides the format of the duration string, and making the timer table concept explicit.

This also fixes up a few minor linking errors, e.g. two elements having the same ID "group".

domenic commented 7 years ago

@domfarolino rebased this

domfarolino commented 7 years ago

@domenic This looks good thanks a lot! My only question is regarding the usage of "info" from my above comment, but as stated we can probably just address https://github.com/whatwg/console/issues/90#issuecomment-289260322 (fancy custom UI per console func) separately; wanted to run it by you though.

domenic commented 7 years ago

Sorry, I can't see your above comment. Yeah, addressing that separately makes sense to me; this preserves the already-existing usage of "info" for now.

domfarolino commented 7 years ago

Odd, gotcha. I was just curious about the already-existing usage of "info". A picture I included in the elusive review comment was basically:

screen shot 2017-04-03 at 10 00 35 pm

showing that implementations seem to use some custom "info" however since we'll be taking care of it elsewhere, makes no difference.

Edit: Also I realized that the reason the comment couldn't be seen is because I never actually "submitted" a review, just had it pending or whatever...oh well lol

refack commented 7 years ago

I wanted to ask what happens when label is not a string. This PR does not call for a ToString conversion, so:

  1. Should it throw for non strings?
  2. Should it do a ToString conversion?
  3. Should it coarse label to string with String('label')?
domenic commented 7 years ago

This specification defines

  // Timing
  void time(optional DOMString label = "default");
  void timeEnd(optional DOMString label = "default");

so your answers are found in the Web IDL specification.

refack commented 7 years ago

@domenic thank you!