Closed
Description
The Chromium console supports format specifiers: https://developers.google.com/web/tools/chrome-devtools/console/console-write#string_substitution_and_formatting
In particular, both %i
and %d
specify an integral argument. Node.js does not perform the conversion for %i
:
/* node.js */
> console.log("%i", 1234)
%i 1234
/* google chrome */
> console.log("%i", 1234)
1234
I think the fix is really simple: the relevant code is at https://github.com/nodejs/node/blob/master/lib/util.js#L86-L117 . Just adding the i
case should be enough:
switch (f.charCodeAt(i + 1)) {
case 105: // 'i' <-- this is the new line, and it should appear just before the `d` case to make the fall through work
case 100: // 'd'
If it makes sense I can send a PR