Unverified Commit 6a0dd1cb authored by Ruben Bridgewater's avatar Ruben Bridgewater Committed by Michaël Zasso
Browse files

util: fix .format() not always calling toString when it should be

This makes sure that `util.format('%s', object)` will always call
a user defined `toString` function. It was formerly not the case
when the object had the function declared on the super class.

At the same time this also makes sure that getters won't be
triggered accessing the `constructor` property.

PR-URL: https://github.com/nodejs/node/pull/30343
Fixes: https://github.com/nodejs/node/issues/30333


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarDenys Otrishko <shishugi@gmail.com>
Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
parent 1040e722
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment