Closed AtkinsSJ closed 1 year ago
Thanks for the issue, this does indeed seem like a problem to me. We my want to handle this as a special case in Formatter, then take away the conditional from Logger. But I'll have to double check this doesn't introduce other problems.
@AtkinsSJ Are you interested in talking a stab at this?
Sure, I'd be happy to!
https://console.spec.whatwg.org/commit-snapshots/6447e9d3cdb01c48094cbaa32d0e5fb1ab74367d/#formatter
Hello! I'm in the process of implementing the console spec in a new browser, and came across some issues with using
result
in the Formatter algorithm.Step 4 in the Formatter algorithm asks us to return
result
:If the first element of
args
did not contain any format specifiers, thenresult
has no value here. This can occur, sincetrace()
,group()
andgroupCollapsed()
all call Formatter without checking that a format specifier is present.I think this is a typo, and step 3.8 should be unindented and appear as step 4. However, if no format specifier was found, that would skip the second element of
args
. So either this needs special handling, or the functions calling Formatter all need to ensure that it does contain a format specifier first, and call Printer otherwise.