console
console copied to clipboard
Reference implementation of the %s format specifier should call String
In the reference implementation for format specifiers, the %s
format specifier is implemented using implicit string coercion and the addition operator:
https://github.com/whatwg/console/blob/88179f2f76e62b765294dffe8a68a7570dd30bb8/reference-implementation/Logger.js#L10 Given the corresponding spec:
If specifier is %s, let converted be the result of Call(%String%, undefined, « current »).
I think explicitly calling the String constructor, as a function, would be a more explicit and accurate way to represent the meaning of the spec.
For example:
'%s': function(a) { return String(a); }, // string
I agree, however we're probably going to rip out the reference implementation and some of the NOTES.md section IIRC, I can double check though.
Seems like this should be closed now?
Agreed, thanks.