Skip to content
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.format with array is different in Node.js 12 #29345

Closed
rosen-vladimirov opened this issue Aug 27, 2019 · 2 comments
Closed

util.format with array is different in Node.js 12 #29345

rosen-vladimirov opened this issue Aug 27, 2019 · 2 comments
Labels
util Issues and PRs related to the built-in util module.

Comments

@rosen-vladimirov
Copy link

  • Version: 12.9.1
  • Platform: Linux rvladimirov-ubuntu 5.0.0-25-generic #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux (same happens on macOS Mojave as well, probably on Windows)
  • Subsystem: util

The result of util.format had changed in Node.js 12:

util.format("result: %s", [ 1, 2])

Node.js 10.15.3 (and in fact all versions below 12): result: 1,2
Node.js 12.9.1 (in fact all 12.x.x versions): result: [ 1, 2 ]

Is this an intentional change?

@addaleax addaleax added the util Issues and PRs related to the built-in util module. label Aug 27, 2019
@addaleax
Copy link
Member

Yes, see #26927 (and, to lesser degree, #27621). I’ve added the semver-major label now, because I think it should definitely have gotten it. That doesn’t automatically affect the changelog, but we can modify that to, if necessary.

@rosen-vladimirov
Copy link
Author

Hey @addaleax ,
Thanks for the fast response. I was looking for this in the Changelog and I've decided to create an issue as I did not find it there. Anyway, as this change is intentional, I'm closing this thread. Just FYI we were relying on the mentioned behavior in our code and our unit tests caught the change of the behavior. Anyway, we'll take a look how to resolve it in our product.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module.
Projects
None yet
Development

No branches or pull requests

2 participants