Skip to content

util: treat all args identically in absence of a format

Unformatted arguments to util.format() are those that trail a format string and the arguments it consumes, and they are all arguments when there is no format string.

This make util.format() behave more as it used to be documented in node v0.10.

Note that since https://github.com/joyent/node/issues/6551, the "inspect everything if there wasn't a leading format string" behaviour was enshrined in the docs. That's the other way to fix things when they don't work as documented, but I don't think the current behaviour makes a lot of sense, see conversations below for more info, and unit tests for example output after this change.

Fixes https://github.com/joyent/node/issues/6551

Replaces https://github.com/joyent/node/pull/6393

Merge request reports

Loading