-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: discrepancy in format() docs vs behavior #935
Comments
Is the issue that primitives are ToString'd? I think the output of util.inspect() is the same except in the case of strings, util.format() wraps them in quotes. That would make for a mildly annoying change: |
Yep, that's the problem. A doc change sounds appropriate. |
Only objects and symbols use `util.inspect`, others are simply concatenated. Fixes: nodejs#935
Only objects and symbols use `util.inspect`, others are simply concatenated. Fixes: #935 PR-URL: #1255 Reviewed-By: Colin Ihrig <[email protected]>
Closed as fixed in |
There is a discrepancy between how the docs say
util.format()
works, and what really happens. The docs state:However, only objects and symbols actually use
util.inspect()
. The required change is trivial, and I think we should bring behavior into line with what the docs say, but this is a slightly breaking change (there is at least one test that fails).Originally reported in #931
The text was updated successfully, but these errors were encountered: